<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE ExistentialQuantification #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE FlexibleContexts #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE RankNTypes #-}</span><span>
</span><span id="line-4"></span><span>
</span><span id="line-5"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- Module      :  Distribution.Simple.Command</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- Copyright   :  Duncan Coutts 2007</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- License     :  BSD3</span><span>
</span><span id="line-10"></span><span class="hs-comment">--</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- Maintainer  :  cabal-devel@haskell.org</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Portability :  non-portable (ExistentialQuantification)</span><span>
</span><span id="line-13"></span><span class="hs-comment">--</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- This is to do with command line handling. The Cabal command line is</span><span>
</span><span id="line-15"></span><span class="hs-comment">-- organised into a number of named sub-commands (much like darcs). The</span><span>
</span><span id="line-16"></span><span class="hs-comment">-- 'CommandUI' abstraction represents one of these sub-commands, with a name,</span><span>
</span><span id="line-17"></span><span class="hs-comment">-- description, a set of flags. Commands can be associated with actions and</span><span>
</span><span id="line-18"></span><span class="hs-comment">-- run. It handles some common stuff automatically, like the @--help@ and</span><span>
</span><span id="line-19"></span><span class="hs-comment">-- command line completion flags. It is designed to allow other tools make</span><span>
</span><span id="line-20"></span><span class="hs-comment">-- derived commands. This feature is used heavily in @cabal-install@.</span><span>
</span><span id="line-21"></span><span>
</span><span id="line-22"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Distribution.Simple.Command</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-23"></span><span>
</span><span id="line-24"></span><span>  </span><span class="annot"><span class="hs-comment">-- * Command interface</span></span><span>
</span><span id="line-25"></span><span>  </span><span class="annot"><a href="Distribution.Simple.Command.html#CommandUI"><span class="hs-identifier">CommandUI</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-26"></span><span>  </span><span class="annot"><a href="Distribution.Simple.Command.html#commandShowOptions"><span class="hs-identifier">commandShowOptions</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-27"></span><span>  </span><span class="annot"><a href="Distribution.Simple.Command.html#CommandParse"><span class="hs-identifier">CommandParse</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-28"></span><span>  </span><span class="annot"><a href="Distribution.Simple.Command.html#commandParseArgs"><span class="hs-identifier">commandParseArgs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-29"></span><span>  </span><span class="annot"><a href="Distribution.Simple.Command.html#getNormalCommandDescriptions"><span class="hs-identifier">getNormalCommandDescriptions</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-30"></span><span>  </span><span class="annot"><a href="Distribution.Simple.Command.html#helpCommandUI"><span class="hs-identifier">helpCommandUI</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-31"></span><span>
</span><span id="line-32"></span><span>  </span><span class="annot"><span class="hs-comment">-- ** Constructing commands</span></span><span>
</span><span id="line-33"></span><span>  </span><span class="annot"><a href="Distribution.Simple.Command.html#ShowOrParseArgs"><span class="hs-identifier">ShowOrParseArgs</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-34"></span><span>  </span><span class="annot"><a href="Distribution.Simple.Command.html#usageDefault"><span class="hs-identifier">usageDefault</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-35"></span><span>  </span><span class="annot"><a href="Distribution.Simple.Command.html#usageAlternatives"><span class="hs-identifier">usageAlternatives</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-36"></span><span>  </span><span class="annot"><a href="Distribution.Simple.Command.html#mkCommandUI"><span class="hs-identifier">mkCommandUI</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-37"></span><span>  </span><span class="annot"><a href="Distribution.Simple.Command.html#hiddenCommand"><span class="hs-identifier">hiddenCommand</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-38"></span><span>
</span><span id="line-39"></span><span>  </span><span class="annot"><span class="hs-comment">-- ** Associating actions with commands</span></span><span>
</span><span id="line-40"></span><span>  </span><span class="annot"><a href="Distribution.Simple.Command.html#Command"><span class="hs-identifier">Command</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-41"></span><span>  </span><span class="annot"><a href="Distribution.Simple.Command.html#commandAddAction"><span class="hs-identifier">commandAddAction</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-42"></span><span>  </span><span class="annot"><a href="Distribution.Simple.Command.html#noExtraFlags"><span class="hs-identifier">noExtraFlags</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-43"></span><span>
</span><span id="line-44"></span><span>  </span><span class="annot"><span class="hs-comment">-- ** Building lists of commands</span></span><span>
</span><span id="line-45"></span><span>  </span><span class="annot"><a href="Distribution.Simple.Command.html#CommandType"><span class="hs-identifier">CommandType</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-46"></span><span>  </span><span class="annot"><a href="Distribution.Simple.Command.html#CommandSpec"><span class="hs-identifier">CommandSpec</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-47"></span><span>  </span><span class="annot"><a href="Distribution.Simple.Command.html#commandFromSpec"><span class="hs-identifier">commandFromSpec</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-48"></span><span>
</span><span id="line-49"></span><span>  </span><span class="annot"><span class="hs-comment">-- ** Running commands</span></span><span>
</span><span id="line-50"></span><span>  </span><span class="annot"><a href="Distribution.Simple.Command.html#commandsRun"><span class="hs-identifier">commandsRun</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-51"></span><span>
</span><span id="line-52"></span><span class="annot"><span class="hs-comment">-- * Option Fields</span></span><span>
</span><span id="line-53"></span><span>  </span><span class="annot"><a href="Distribution.Simple.Command.html#OptionField"><span class="hs-identifier">OptionField</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#Name"><span class="hs-identifier">Name</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-54"></span><span>
</span><span id="line-55"></span><span class="annot"><span class="hs-comment">-- ** Constructing Option Fields</span></span><span>
</span><span id="line-56"></span><span>  </span><span class="annot"><a href="Distribution.Simple.Command.html#option"><span class="hs-identifier">option</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#multiOption"><span class="hs-identifier">multiOption</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-57"></span><span>
</span><span id="line-58"></span><span class="annot"><span class="hs-comment">-- ** Liftings &amp; Projections</span></span><span>
</span><span id="line-59"></span><span>  </span><span class="annot"><a href="Distribution.Simple.Command.html#liftOption"><span class="hs-identifier">liftOption</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#liftOptionL"><span class="hs-identifier">liftOptionL</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-60"></span><span>
</span><span id="line-61"></span><span class="annot"><span class="hs-comment">-- * Option Descriptions</span></span><span>
</span><span id="line-62"></span><span>  </span><span class="annot"><a href="Distribution.Simple.Command.html#OptDescr"><span class="hs-identifier">OptDescr</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#Description"><span class="hs-identifier">Description</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#SFlags"><span class="hs-identifier">SFlags</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#LFlags"><span class="hs-identifier">LFlags</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#OptFlags"><span class="hs-identifier">OptFlags</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#ArgPlaceHolder"><span class="hs-identifier">ArgPlaceHolder</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-63"></span><span>
</span><span id="line-64"></span><span class="annot"><span class="hs-comment">-- ** OptDescr 'smart' constructors</span></span><span>
</span><span id="line-65"></span><span>  </span><span class="annot"><a href="Distribution.Simple.Command.html#MkOptDescr"><span class="hs-identifier">MkOptDescr</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-66"></span><span>  </span><span class="annot"><a href="Distribution.Simple.Command.html#reqArg"><span class="hs-identifier">reqArg</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#reqArg%27"><span class="hs-identifier">reqArg'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#optArg"><span class="hs-identifier">optArg</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#optArg%27"><span class="hs-identifier">optArg'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#noArg"><span class="hs-identifier">noArg</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-67"></span><span>  </span><span class="annot"><a href="Distribution.Simple.Command.html#boolOpt"><span class="hs-identifier">boolOpt</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#boolOpt%27"><span class="hs-identifier">boolOpt'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#choiceOpt"><span class="hs-identifier">choiceOpt</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#choiceOptFromEnum"><span class="hs-identifier">choiceOptFromEnum</span></a></span><span>
</span><span id="line-68"></span><span>
</span><span id="line-69"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-70"></span><span>
</span><span id="line-71"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Prelude.html#"><span class="hs-identifier">Prelude</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-72"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Compat.Prelude.html"><span class="hs-identifier">Distribution.Compat.Prelude</span></a></span><span> </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier">get</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-73"></span><span>
</span><span id="line-74"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Distribution.GetOpt.html"><span class="hs-identifier">Distribution.GetOpt</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">GetOpt</span></span><span>
</span><span id="line-75"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.ReadE.html"><span class="hs-identifier">Distribution.ReadE</span></a></span><span>
</span><span id="line-76"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Simple.Utils.html"><span class="hs-identifier">Distribution.Simple.Utils</span></a></span><span>
</span><span id="line-77"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Compat.Lens.html"><span class="hs-identifier">Distribution.Compat.Lens</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Compat.Lens.html#ALens%27"><span class="hs-identifier">ALens'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Compat.Lens.html#%5E%23"><span class="hs-operator">(^#)</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Compat.Lens.html#%23~"><span class="hs-operator">(#~)</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-78"></span><span>
</span><span id="line-79"></span><span>
</span><span id="line-80"></span><span class="hs-keyword">data</span><span> </span><span id="CommandUI"><span class="annot"><a href="Distribution.Simple.Command.html#CommandUI"><span class="hs-identifier hs-var">CommandUI</span></a></span></span><span> </span><span id="local-6989586621679689857"><span class="annot"><a href="#local-6989586621679689857"><span class="hs-identifier hs-type">flags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="CommandUI"><span class="annot"><a href="Distribution.Simple.Command.html#CommandUI"><span class="hs-identifier hs-var">CommandUI</span></a></span></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-81"></span><span>    </span><span class="hs-comment">-- | The name of the command as it would be entered on the command line.</span><span>
</span><span id="line-82"></span><span>    </span><span class="hs-comment">-- For example @\&quot;build\&quot;@.</span><span>
</span><span id="line-83"></span><span>    </span><span id="commandName"><span class="annot"><span class="annottext">forall flags. CommandUI flags -&gt; String
</span><a href="Distribution.Simple.Command.html#commandName"><span class="hs-identifier hs-var hs-var">commandName</span></a></span></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-84"></span><span>    </span><span class="hs-comment">-- | A short, one line description of the command to use in help texts.</span><span>
</span><span id="line-85"></span><span>    </span><span id="commandSynopsis"><span class="annot"><span class="annottext">forall flags. CommandUI flags -&gt; String
</span><a href="Distribution.Simple.Command.html#commandSynopsis"><span class="hs-identifier hs-var hs-var">commandSynopsis</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-86"></span><span>    </span><span class="hs-comment">-- | A function that maps a program name to a usage summary for this</span><span>
</span><span id="line-87"></span><span>    </span><span class="hs-comment">-- command.</span><span>
</span><span id="line-88"></span><span>    </span><span id="commandUsage"><span class="annot"><span class="annottext">forall flags. CommandUI flags -&gt; String -&gt; String
</span><a href="Distribution.Simple.Command.html#commandUsage"><span class="hs-identifier hs-var hs-var">commandUsage</span></a></span></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-89"></span><span>    </span><span class="hs-comment">-- | Additional explanation of the command to use in help texts.</span><span>
</span><span id="line-90"></span><span>    </span><span id="commandDescription"><span class="annot"><span class="annottext">forall flags. CommandUI flags -&gt; Maybe (String -&gt; String)
</span><a href="Distribution.Simple.Command.html#commandDescription"><span class="hs-identifier hs-var hs-var">commandDescription</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-91"></span><span>    </span><span class="hs-comment">-- | Post-Usage notes and examples in help texts</span><span>
</span><span id="line-92"></span><span>    </span><span id="commandNotes"><span class="annot"><span class="annottext">forall flags. CommandUI flags -&gt; Maybe (String -&gt; String)
</span><a href="Distribution.Simple.Command.html#commandNotes"><span class="hs-identifier hs-var hs-var">commandNotes</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-93"></span><span>    </span><span class="hs-comment">-- | Initial \/ empty flags</span><span>
</span><span id="line-94"></span><span>    </span><span id="commandDefaultFlags"><span class="annot"><span class="annottext">forall flags. CommandUI flags -&gt; flags
</span><a href="Distribution.Simple.Command.html#commandDefaultFlags"><span class="hs-identifier hs-var hs-var">commandDefaultFlags</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679689857"><span class="hs-identifier hs-type">flags</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-95"></span><span>    </span><span class="hs-comment">-- | All the Option fields for this command</span><span>
</span><span id="line-96"></span><span>    </span><span id="commandOptions"><span class="annot"><span class="annottext">forall flags.
CommandUI flags -&gt; ShowOrParseArgs -&gt; [OptionField flags]
</span><a href="Distribution.Simple.Command.html#commandOptions"><span class="hs-identifier hs-var hs-var">commandOptions</span></a></span></span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#ShowOrParseArgs"><span class="hs-identifier hs-type">ShowOrParseArgs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Simple.Command.html#OptionField"><span class="hs-identifier hs-type">OptionField</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689857"><span class="hs-identifier hs-type">flags</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-97"></span><span>  </span><span class="hs-special">}</span><span>
</span><span id="line-98"></span><span>
</span><span id="line-99"></span><span class="hs-keyword">data</span><span> </span><span id="ShowOrParseArgs"><span class="annot"><a href="Distribution.Simple.Command.html#ShowOrParseArgs"><span class="hs-identifier hs-var">ShowOrParseArgs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="ShowArgs"><span class="annot"><a href="Distribution.Simple.Command.html#ShowArgs"><span class="hs-identifier hs-var">ShowArgs</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="ParseArgs"><span class="annot"><a href="Distribution.Simple.Command.html#ParseArgs"><span class="hs-identifier hs-var">ParseArgs</span></a></span></span><span>
</span><span id="line-100"></span><span class="hs-keyword">type</span><span> </span><span id="Name"><span class="annot"><a href="Distribution.Simple.Command.html#Name"><span class="hs-identifier hs-var">Name</span></a></span></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-101"></span><span class="hs-keyword">type</span><span> </span><span id="Description"><span class="annot"><a href="Distribution.Simple.Command.html#Description"><span class="hs-identifier hs-var">Description</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-102"></span><span>
</span><span id="line-103"></span><span class="hs-comment">-- | We usually have a data type for storing configuration values, where</span><span>
</span><span id="line-104"></span><span class="hs-comment">--   every field stores a configuration option, and the user sets</span><span>
</span><span id="line-105"></span><span class="hs-comment">--   the value either via command line flags or a configuration file.</span><span>
</span><span id="line-106"></span><span class="hs-comment">--   An individual OptionField models such a field, and we usually</span><span>
</span><span id="line-107"></span><span class="hs-comment">--   build a list of options associated to a configuration data type.</span><span>
</span><span id="line-108"></span><span class="hs-keyword">data</span><span> </span><span id="OptionField"><span class="annot"><a href="Distribution.Simple.Command.html#OptionField"><span class="hs-identifier hs-var">OptionField</span></a></span></span><span> </span><span id="local-6989586621679689846"><span class="annot"><a href="#local-6989586621679689846"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="OptionField"><span class="annot"><a href="Distribution.Simple.Command.html#OptionField"><span class="hs-identifier hs-var">OptionField</span></a></span></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-109"></span><span>  </span><span id="optionName"><span class="annot"><span class="annottext">forall a. OptionField a -&gt; String
</span><a href="Distribution.Simple.Command.html#optionName"><span class="hs-identifier hs-var hs-var">optionName</span></a></span></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-110"></span><span>  </span><span id="optionDescr"><span class="annot"><span class="annottext">forall a. OptionField a -&gt; [OptDescr a]
</span><a href="Distribution.Simple.Command.html#optionDescr"><span class="hs-identifier hs-var hs-var">optionDescr</span></a></span></span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Simple.Command.html#OptDescr"><span class="hs-identifier hs-type">OptDescr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689846"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-111"></span><span>
</span><span id="line-112"></span><span class="hs-comment">-- | An OptionField takes one or more OptDescrs, describing the command line</span><span>
</span><span id="line-113"></span><span class="hs-comment">-- interface for the field.</span><span>
</span><span id="line-114"></span><span class="hs-keyword">data</span><span> </span><span id="OptDescr"><span class="annot"><a href="Distribution.Simple.Command.html#OptDescr"><span class="hs-identifier hs-var">OptDescr</span></a></span></span><span> </span><span id="local-6989586621679689815"><span class="annot"><a href="#local-6989586621679689815"><span class="hs-identifier hs-type">a</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="ReqArg"><span class="annot"><a href="Distribution.Simple.Command.html#ReqArg"><span class="hs-identifier hs-var">ReqArg</span></a></span></span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#Description"><span class="hs-identifier hs-type">Description</span></a></span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#OptFlags"><span class="hs-identifier hs-type">OptFlags</span></a></span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#ArgPlaceHolder"><span class="hs-identifier hs-type">ArgPlaceHolder</span></a></span><span>
</span><span id="line-115"></span><span>                   </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.ReadE.html#ReadE"><span class="hs-identifier hs-type">ReadE</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689815"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-glyph">-&gt;</span><span class="annot"><a href="#local-6989586621679689815"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689815"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-116"></span><span>
</span><span id="line-117"></span><span>                 </span><span class="hs-glyph">|</span><span> </span><span id="OptArg"><span class="annot"><a href="Distribution.Simple.Command.html#OptArg"><span class="hs-identifier hs-var">OptArg</span></a></span></span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#Description"><span class="hs-identifier hs-type">Description</span></a></span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#OptFlags"><span class="hs-identifier hs-type">OptFlags</span></a></span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#ArgPlaceHolder"><span class="hs-identifier hs-type">ArgPlaceHolder</span></a></span><span>
</span><span id="line-118"></span><span>                   </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.ReadE.html#ReadE"><span class="hs-identifier hs-type">ReadE</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689815"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-glyph">-&gt;</span><span class="annot"><a href="#local-6989586621679689815"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689815"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-glyph">-&gt;</span><span class="annot"><a href="#local-6989586621679689815"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>  </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689815"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-119"></span><span>
</span><span id="line-120"></span><span>                 </span><span class="hs-glyph">|</span><span> </span><span id="ChoiceOpt"><span class="annot"><a href="Distribution.Simple.Command.html#ChoiceOpt"><span class="hs-identifier hs-var">ChoiceOpt</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Command.html#Description"><span class="hs-identifier hs-type">Description</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#OptFlags"><span class="hs-identifier hs-type">OptFlags</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679689815"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-glyph">-&gt;</span><span class="annot"><a href="#local-6989586621679689815"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679689815"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-121"></span><span>
</span><span id="line-122"></span><span>                 </span><span class="hs-glyph">|</span><span> </span><span id="BoolOpt"><span class="annot"><a href="Distribution.Simple.Command.html#BoolOpt"><span class="hs-identifier hs-var">BoolOpt</span></a></span></span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#Description"><span class="hs-identifier hs-type">Description</span></a></span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#OptFlags"><span class="hs-identifier hs-type">OptFlags</span></a></span><span class="hs-comment">{-True-}</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#OptFlags"><span class="hs-identifier hs-type">OptFlags</span></a></span><span class="hs-comment">{-False-}</span><span>
</span><span id="line-123"></span><span>                   </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689815"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689815"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689815"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">)</span><span>
</span><span id="line-124"></span><span>
</span><span id="line-125"></span><span class="hs-comment">-- | Short command line option strings</span><span>
</span><span id="line-126"></span><span class="hs-keyword">type</span><span> </span><span id="SFlags"><span class="annot"><a href="Distribution.Simple.Command.html#SFlags"><span class="hs-identifier hs-var">SFlags</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span class="hs-special">]</span><span>
</span><span id="line-127"></span><span class="hs-comment">-- | Long command line option strings</span><span>
</span><span id="line-128"></span><span class="hs-keyword">type</span><span> </span><span id="LFlags"><span class="annot"><a href="Distribution.Simple.Command.html#LFlags"><span class="hs-identifier hs-var">LFlags</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-129"></span><span class="hs-keyword">type</span><span> </span><span id="OptFlags"><span class="annot"><a href="Distribution.Simple.Command.html#OptFlags"><span class="hs-identifier hs-var">OptFlags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Command.html#SFlags"><span class="hs-identifier hs-type">SFlags</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Distribution.Simple.Command.html#LFlags"><span class="hs-identifier hs-type">LFlags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-130"></span><span class="hs-keyword">type</span><span> </span><span id="ArgPlaceHolder"><span class="annot"><a href="Distribution.Simple.Command.html#ArgPlaceHolder"><span class="hs-identifier hs-var">ArgPlaceHolder</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-131"></span><span>
</span><span id="line-132"></span><span>
</span><span id="line-133"></span><span class="hs-comment">-- | Create an option taking a single OptDescr.</span><span>
</span><span id="line-134"></span><span class="hs-comment">--   No explicit Name is given for the Option, the name is the first LFlag given.</span><span>
</span><span id="line-135"></span><span id="local-6989586621679689839"><span id="local-6989586621679689840"><span id="local-6989586621679689841"><span class="annot"><a href="Distribution.Simple.Command.html#option"><span class="hs-identifier hs-type">option</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#SFlags"><span class="hs-identifier hs-type">SFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#LFlags"><span class="hs-identifier hs-type">LFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#Description"><span class="hs-identifier hs-type">Description</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689841"><span class="hs-identifier hs-type">get</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689840"><span class="hs-identifier hs-type">set</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#MkOptDescr"><span class="hs-identifier hs-type">MkOptDescr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689841"><span class="hs-identifier hs-type">get</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689840"><span class="hs-identifier hs-type">set</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689839"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-136"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#OptionField"><span class="hs-identifier hs-type">OptionField</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689839"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-137"></span><span id="option"><span class="annot"><span class="annottext">option :: forall get set a.
String
-&gt; LFlags
-&gt; String
-&gt; get
-&gt; set
-&gt; MkOptDescr get set a
-&gt; OptionField a
</span><a href="Distribution.Simple.Command.html#option"><span class="hs-identifier hs-var hs-var">option</span></a></span></span><span> </span><span id="local-6989586621679689578"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689578"><span class="hs-identifier hs-var">sf</span></a></span></span><span> </span><span id="local-6989586621679689577"><span class="annot"><span class="annottext">lf :: LFlags
</span><a href="#local-6989586621679689577"><span class="hs-identifier hs-var">lf</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span id="local-6989586621679689576"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689576"><span class="hs-identifier hs-var">n</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span class="annot"><span class="annottext">LFlags
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679689575"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689575"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span id="local-6989586621679689574"><span class="annot"><span class="annottext">get
</span><a href="#local-6989586621679689574"><span class="hs-identifier hs-var">get</span></a></span></span><span> </span><span id="local-6989586621679689573"><span class="annot"><span class="annottext">set
</span><a href="#local-6989586621679689573"><span class="hs-identifier hs-var">set</span></a></span></span><span> </span><span id="local-6989586621679689572"><span class="annot"><span class="annottext">MkOptDescr get set a
</span><a href="#local-6989586621679689572"><span class="hs-identifier hs-var">arg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; [OptDescr a] -&gt; OptionField a
forall a. String -&gt; [OptDescr a] -&gt; OptionField a
</span><a href="Distribution.Simple.Command.html#OptionField"><span class="hs-identifier hs-var">OptionField</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689576"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">MkOptDescr get set a
</span><a href="#local-6989586621679689572"><span class="hs-identifier hs-var">arg</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689578"><span class="hs-identifier hs-var">sf</span></a></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689577"><span class="hs-identifier hs-var">lf</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689575"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">get
</span><a href="#local-6989586621679689574"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="annot"><span class="annottext">set
</span><a href="#local-6989586621679689573"><span class="hs-identifier hs-var">set</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-138"></span><span class="annot"><a href="Distribution.Simple.Command.html#option"><span class="hs-identifier hs-var">option</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">get
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">set
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">MkOptDescr get set a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; OptionField a
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; OptionField a) -&gt; String -&gt; OptionField a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Distribution.command.option: &quot;</span></span><span>
</span><span id="line-139"></span><span>                     </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;An OptionField must have at least one LFlag&quot;</span></span><span>
</span><span id="line-140"></span><span>
</span><span id="line-141"></span><span class="hs-comment">-- | Create an option taking several OptDescrs.</span><span>
</span><span id="line-142"></span><span class="hs-comment">--   You will have to give the flags and description individually to the</span><span>
</span><span id="line-143"></span><span class="hs-comment">--   OptDescr constructor.</span><span>
</span><span id="line-144"></span><span id="local-6989586621679689825"><span id="local-6989586621679689826"><span id="local-6989586621679689827"><span class="annot"><a href="Distribution.Simple.Command.html#multiOption"><span class="hs-identifier hs-type">multiOption</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689827"><span class="hs-identifier hs-type">get</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689826"><span class="hs-identifier hs-type">set</span></a></span><span>
</span><span id="line-145"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679689827"><span class="hs-identifier hs-type">get</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689826"><span class="hs-identifier hs-type">set</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#OptDescr"><span class="hs-identifier hs-type">OptDescr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689825"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span>  </span><span class="hs-comment">-- ^MkOptDescr constructors partially</span><span>
</span><span id="line-146"></span><span>                                           </span><span class="hs-comment">-- applied to flags and description.</span><span>
</span><span id="line-147"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#OptionField"><span class="hs-identifier hs-type">OptionField</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689825"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-148"></span><span id="multiOption"><span class="annot"><span class="annottext">multiOption :: forall get set a.
String -&gt; get -&gt; set -&gt; [get -&gt; set -&gt; OptDescr a] -&gt; OptionField a
</span><a href="Distribution.Simple.Command.html#multiOption"><span class="hs-identifier hs-var hs-var">multiOption</span></a></span></span><span> </span><span id="local-6989586621679689570"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689570"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679689569"><span class="annot"><span class="annottext">get
</span><a href="#local-6989586621679689569"><span class="hs-identifier hs-var">get</span></a></span></span><span> </span><span id="local-6989586621679689568"><span class="annot"><span class="annottext">set
</span><a href="#local-6989586621679689568"><span class="hs-identifier hs-var">set</span></a></span></span><span> </span><span id="local-6989586621679689567"><span class="annot"><span class="annottext">[get -&gt; set -&gt; OptDescr a]
</span><a href="#local-6989586621679689567"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; [OptDescr a] -&gt; OptionField a
forall a. String -&gt; [OptDescr a] -&gt; OptionField a
</span><a href="Distribution.Simple.Command.html#OptionField"><span class="hs-identifier hs-var">OptionField</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689570"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">get -&gt; set -&gt; OptDescr a
</span><a href="#local-6989586621679689566"><span class="hs-identifier hs-var">arg</span></a></span><span> </span><span class="annot"><span class="annottext">get
</span><a href="#local-6989586621679689569"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="annot"><span class="annottext">set
</span><a href="#local-6989586621679689568"><span class="hs-identifier hs-var">set</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679689566"><span class="annot"><span class="annottext">get -&gt; set -&gt; OptDescr a
</span><a href="#local-6989586621679689566"><span class="hs-identifier hs-var">arg</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[get -&gt; set -&gt; OptDescr a]
</span><a href="#local-6989586621679689567"><span class="hs-identifier hs-var">args</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-149"></span><span>
</span><span id="line-150"></span><span class="hs-keyword">type</span><span> </span><span id="MkOptDescr"><span class="annot"><a href="Distribution.Simple.Command.html#MkOptDescr"><span class="hs-identifier hs-var">MkOptDescr</span></a></span></span><span> </span><span id="local-6989586621679689565"><span class="annot"><a href="#local-6989586621679689565"><span class="hs-identifier hs-type">get</span></a></span></span><span> </span><span id="local-6989586621679689564"><span class="annot"><a href="#local-6989586621679689564"><span class="hs-identifier hs-type">set</span></a></span></span><span> </span><span id="local-6989586621679689563"><span class="annot"><a href="#local-6989586621679689563"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#SFlags"><span class="hs-identifier hs-type">SFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#LFlags"><span class="hs-identifier hs-type">LFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#Description"><span class="hs-identifier hs-type">Description</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689565"><span class="hs-identifier hs-type">get</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689564"><span class="hs-identifier hs-type">set</span></a></span><span>
</span><span id="line-151"></span><span>                            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#OptDescr"><span class="hs-identifier hs-type">OptDescr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689563"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-152"></span><span>
</span><span id="line-153"></span><span class="hs-comment">-- | Create a string-valued command line interface.</span><span>
</span><span id="line-154"></span><span id="local-6989586621679689819"><span id="local-6989586621679689821"><span class="annot"><a href="Distribution.Simple.Command.html#reqArg"><span class="hs-identifier hs-type">reqArg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689821"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#ArgPlaceHolder"><span class="hs-identifier hs-type">ArgPlaceHolder</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.ReadE.html#ReadE"><span class="hs-identifier hs-type">ReadE</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689821"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689821"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-155"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#MkOptDescr"><span class="hs-identifier hs-type">MkOptDescr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689819"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689821"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689821"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689819"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689819"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679689819"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-156"></span><span id="reqArg"><span class="annot"><span class="annottext">reqArg :: forall b a.
Monoid b =&gt;
String
-&gt; ReadE b -&gt; (b -&gt; LFlags) -&gt; MkOptDescr (a -&gt; b) (b -&gt; a -&gt; a) a
</span><a href="Distribution.Simple.Command.html#reqArg"><span class="hs-identifier hs-var hs-var">reqArg</span></a></span></span><span> </span><span id="local-6989586621679689558"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689558"><span class="hs-identifier hs-var">ad</span></a></span></span><span> </span><span id="local-6989586621679689557"><span class="annot"><span class="annottext">ReadE b
</span><a href="#local-6989586621679689557"><span class="hs-identifier hs-var">mkflag</span></a></span></span><span> </span><span id="local-6989586621679689556"><span class="annot"><span class="annottext">b -&gt; LFlags
</span><a href="#local-6989586621679689556"><span class="hs-identifier hs-var">showflag</span></a></span></span><span> </span><span id="local-6989586621679689555"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689555"><span class="hs-identifier hs-var">sf</span></a></span></span><span> </span><span id="local-6989586621679689554"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689554"><span class="hs-identifier hs-var">lf</span></a></span></span><span> </span><span id="local-6989586621679689553"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689553"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span id="local-6989586621679689552"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679689552"><span class="hs-identifier hs-var">get</span></a></span></span><span> </span><span id="local-6989586621679689551"><span class="annot"><span class="annottext">b -&gt; a -&gt; a
</span><a href="#local-6989586621679689551"><span class="hs-identifier hs-var">set</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-157"></span><span>  </span><span class="annot"><span class="annottext">String
-&gt; OptFlags
-&gt; String
-&gt; ReadE (a -&gt; a)
-&gt; (a -&gt; LFlags)
-&gt; OptDescr a
forall a.
String
-&gt; OptFlags
-&gt; String
-&gt; ReadE (a -&gt; a)
-&gt; (a -&gt; LFlags)
-&gt; OptDescr a
</span><a href="Distribution.Simple.Command.html#ReqArg"><span class="hs-identifier hs-var">ReqArg</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689553"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689555"><span class="hs-identifier hs-var">sf</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689554"><span class="hs-identifier hs-var">lf</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689558"><span class="hs-identifier hs-var">ad</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(b -&gt; a -&gt; a) -&gt; ReadE b -&gt; ReadE (a -&gt; a)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679689550"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679689550"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679689549"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679689549"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">b -&gt; a -&gt; a
</span><a href="#local-6989586621679689551"><span class="hs-identifier hs-var">set</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679689552"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679689549"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; b -&gt; b
forall a. Monoid a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-operator hs-var">`mappend`</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679689550"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679689549"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ReadE b
</span><a href="#local-6989586621679689557"><span class="hs-identifier hs-var">mkflag</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-158"></span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; LFlags
</span><a href="#local-6989586621679689556"><span class="hs-identifier hs-var">showflag</span></a></span><span> </span><span class="annot"><span class="annottext">(b -&gt; LFlags) -&gt; (a -&gt; b) -&gt; a -&gt; LFlags
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679689552"><span class="hs-identifier hs-var">get</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-159"></span><span>
</span><span id="line-160"></span><span class="hs-comment">-- | Create a string-valued command line interface with a default value.</span><span>
</span><span id="line-161"></span><span id="local-6989586621679689806"><span id="local-6989586621679689807"><span class="annot"><a href="Distribution.Simple.Command.html#optArg"><span class="hs-identifier hs-type">optArg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689807"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#ArgPlaceHolder"><span class="hs-identifier hs-type">ArgPlaceHolder</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.ReadE.html#ReadE"><span class="hs-identifier hs-type">ReadE</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689807"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689807"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689807"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-162"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#MkOptDescr"><span class="hs-identifier hs-type">MkOptDescr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689806"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689807"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689807"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689806"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689806"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679689806"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-163"></span><span id="optArg"><span class="annot"><span class="annottext">optArg :: forall b a.
Monoid b =&gt;
String
-&gt; ReadE b
-&gt; b
-&gt; (b -&gt; [Maybe String])
-&gt; MkOptDescr (a -&gt; b) (b -&gt; a -&gt; a) a
</span><a href="Distribution.Simple.Command.html#optArg"><span class="hs-identifier hs-var hs-var">optArg</span></a></span></span><span> </span><span id="local-6989586621679689543"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689543"><span class="hs-identifier hs-var">ad</span></a></span></span><span> </span><span id="local-6989586621679689542"><span class="annot"><span class="annottext">ReadE b
</span><a href="#local-6989586621679689542"><span class="hs-identifier hs-var">mkflag</span></a></span></span><span> </span><span id="local-6989586621679689541"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679689541"><span class="hs-identifier hs-var">def</span></a></span></span><span> </span><span id="local-6989586621679689540"><span class="annot"><span class="annottext">b -&gt; [Maybe String]
</span><a href="#local-6989586621679689540"><span class="hs-identifier hs-var">showflag</span></a></span></span><span> </span><span id="local-6989586621679689539"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689539"><span class="hs-identifier hs-var">sf</span></a></span></span><span> </span><span id="local-6989586621679689538"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689538"><span class="hs-identifier hs-var">lf</span></a></span></span><span> </span><span id="local-6989586621679689537"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689537"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span id="local-6989586621679689536"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679689536"><span class="hs-identifier hs-var">get</span></a></span></span><span> </span><span id="local-6989586621679689535"><span class="annot"><span class="annottext">b -&gt; a -&gt; a
</span><a href="#local-6989586621679689535"><span class="hs-identifier hs-var">set</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span>
</span><span id="line-164"></span><span>  </span><span class="annot"><span class="annottext">String
-&gt; OptFlags
-&gt; String
-&gt; ReadE (a -&gt; a)
-&gt; (a -&gt; a)
-&gt; (a -&gt; [Maybe String])
-&gt; OptDescr a
forall a.
String
-&gt; OptFlags
-&gt; String
-&gt; ReadE (a -&gt; a)
-&gt; (a -&gt; a)
-&gt; (a -&gt; [Maybe String])
-&gt; OptDescr a
</span><a href="Distribution.Simple.Command.html#OptArg"><span class="hs-identifier hs-var">OptArg</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689537"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689539"><span class="hs-identifier hs-var">sf</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689538"><span class="hs-identifier hs-var">lf</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689543"><span class="hs-identifier hs-var">ad</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(b -&gt; a -&gt; a) -&gt; ReadE b -&gt; ReadE (a -&gt; a)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679689534"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679689534"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679689533"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679689533"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">b -&gt; a -&gt; a
</span><a href="#local-6989586621679689535"><span class="hs-identifier hs-var">set</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679689536"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679689533"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; b -&gt; b
forall a. Monoid a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-operator hs-var">`mappend`</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679689534"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679689533"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ReadE b
</span><a href="#local-6989586621679689542"><span class="hs-identifier hs-var">mkflag</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-165"></span><span>               </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679689532"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679689532"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>          </span><span class="annot"><span class="annottext">b -&gt; a -&gt; a
</span><a href="#local-6989586621679689535"><span class="hs-identifier hs-var">set</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679689536"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679689532"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; b -&gt; b
forall a. Monoid a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-operator hs-var">`mappend`</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679689541"><span class="hs-identifier hs-var">def</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679689532"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-166"></span><span>               </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; [Maybe String]
</span><a href="#local-6989586621679689540"><span class="hs-identifier hs-var">showflag</span></a></span><span> </span><span class="annot"><span class="annottext">(b -&gt; [Maybe String]) -&gt; (a -&gt; b) -&gt; a -&gt; [Maybe String]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679689536"><span class="hs-identifier hs-var">get</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-167"></span><span>
</span><span id="line-168"></span><span class="hs-comment">-- | (String -&gt; a) variant of &quot;reqArg&quot;</span><span>
</span><span id="line-169"></span><span id="local-6989586621679689802"><span id="local-6989586621679689803"><span class="annot"><a href="Distribution.Simple.Command.html#reqArg%27"><span class="hs-identifier hs-type">reqArg'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689803"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#ArgPlaceHolder"><span class="hs-identifier hs-type">ArgPlaceHolder</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689803"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689803"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-170"></span><span>                    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#MkOptDescr"><span class="hs-identifier hs-type">MkOptDescr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689802"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689803"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689803"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689802"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689802"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679689802"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-171"></span><span id="reqArg%27"><span class="annot"><span class="annottext">reqArg' :: forall b a.
Monoid b =&gt;
String
-&gt; (String -&gt; b)
-&gt; (b -&gt; LFlags)
-&gt; MkOptDescr (a -&gt; b) (b -&gt; a -&gt; a) a
</span><a href="Distribution.Simple.Command.html#reqArg%27"><span class="hs-identifier hs-var hs-var">reqArg'</span></a></span></span><span> </span><span id="local-6989586621679689529"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689529"><span class="hs-identifier hs-var">ad</span></a></span></span><span> </span><span id="local-6989586621679689528"><span class="annot"><span class="annottext">String -&gt; b
</span><a href="#local-6989586621679689528"><span class="hs-identifier hs-var">mkflag</span></a></span></span><span> </span><span id="local-6989586621679689527"><span class="annot"><span class="annottext">b -&gt; LFlags
</span><a href="#local-6989586621679689527"><span class="hs-identifier hs-var">showflag</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-172"></span><span>    </span><span class="annot"><span class="annottext">String
-&gt; ReadE b -&gt; (b -&gt; LFlags) -&gt; MkOptDescr (a -&gt; b) (b -&gt; a -&gt; a) a
forall b a.
Monoid b =&gt;
String
-&gt; ReadE b -&gt; (b -&gt; LFlags) -&gt; MkOptDescr (a -&gt; b) (b -&gt; a -&gt; a) a
</span><a href="Distribution.Simple.Command.html#reqArg"><span class="hs-identifier hs-var">reqArg</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689529"><span class="hs-identifier hs-var">ad</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(String -&gt; b) -&gt; ReadE b
forall a. (String -&gt; a) -&gt; ReadE a
</span><a href="Distribution.ReadE.html#succeedReadE"><span class="hs-identifier hs-var">succeedReadE</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; b
</span><a href="#local-6989586621679689528"><span class="hs-identifier hs-var">mkflag</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">b -&gt; LFlags
</span><a href="#local-6989586621679689527"><span class="hs-identifier hs-var">showflag</span></a></span><span>
</span><span id="line-173"></span><span>
</span><span id="line-174"></span><span class="hs-comment">-- | (String -&gt; a) variant of &quot;optArg&quot;</span><span>
</span><span id="line-175"></span><span id="local-6989586621679689797"><span id="local-6989586621679689798"><span class="annot"><a href="Distribution.Simple.Command.html#optArg%27"><span class="hs-identifier hs-type">optArg'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689798"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#ArgPlaceHolder"><span class="hs-identifier hs-type">ArgPlaceHolder</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689798"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-176"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689798"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-177"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#MkOptDescr"><span class="hs-identifier hs-type">MkOptDescr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689797"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689798"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689798"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689797"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689797"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679689797"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-178"></span><span id="optArg%27"><span class="annot"><span class="annottext">optArg' :: forall b a.
Monoid b =&gt;
String
-&gt; (Maybe String -&gt; b)
-&gt; (b -&gt; [Maybe String])
-&gt; MkOptDescr (a -&gt; b) (b -&gt; a -&gt; a) a
</span><a href="Distribution.Simple.Command.html#optArg%27"><span class="hs-identifier hs-var hs-var">optArg'</span></a></span></span><span> </span><span id="local-6989586621679689523"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689523"><span class="hs-identifier hs-var">ad</span></a></span></span><span> </span><span id="local-6989586621679689522"><span class="annot"><span class="annottext">Maybe String -&gt; b
</span><a href="#local-6989586621679689522"><span class="hs-identifier hs-var">mkflag</span></a></span></span><span> </span><span id="local-6989586621679689521"><span class="annot"><span class="annottext">b -&gt; [Maybe String]
</span><a href="#local-6989586621679689521"><span class="hs-identifier hs-var">showflag</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-179"></span><span>    </span><span class="annot"><span class="annottext">String
-&gt; ReadE b
-&gt; b
-&gt; (b -&gt; [Maybe String])
-&gt; MkOptDescr (a -&gt; b) (b -&gt; a -&gt; a) a
forall b a.
Monoid b =&gt;
String
-&gt; ReadE b
-&gt; b
-&gt; (b -&gt; [Maybe String])
-&gt; MkOptDescr (a -&gt; b) (b -&gt; a -&gt; a) a
</span><a href="Distribution.Simple.Command.html#optArg"><span class="hs-identifier hs-var">optArg</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689523"><span class="hs-identifier hs-var">ad</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(String -&gt; b) -&gt; ReadE b
forall a. (String -&gt; a) -&gt; ReadE a
</span><a href="Distribution.ReadE.html#succeedReadE"><span class="hs-identifier hs-var">succeedReadE</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe String -&gt; b
</span><a href="#local-6989586621679689522"><span class="hs-identifier hs-var">mkflag</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe String -&gt; b) -&gt; (String -&gt; Maybe String) -&gt; String -&gt; b
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; Maybe String
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679689520"><span class="hs-identifier hs-var">def</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; [Maybe String]
</span><a href="#local-6989586621679689521"><span class="hs-identifier hs-var">showflag</span></a></span><span>
</span><span id="line-180"></span><span>      </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679689520"><span class="annot"><span class="annottext">def :: b
</span><a href="#local-6989586621679689520"><span class="hs-identifier hs-var hs-var">def</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe String -&gt; b
</span><a href="#local-6989586621679689522"><span class="hs-identifier hs-var">mkflag</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe String
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-181"></span><span>
</span><span id="line-182"></span><span id="local-6989586621679689792"><span id="local-6989586621679689793"><span class="annot"><a href="Distribution.Simple.Command.html#noArg"><span class="hs-identifier hs-type">noArg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Eq</span></span><span> </span><span class="annot"><a href="#local-6989586621679689793"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689793"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#MkOptDescr"><span class="hs-identifier hs-type">MkOptDescr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689792"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689793"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689793"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689792"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689792"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679689792"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-183"></span><span id="noArg"><span class="annot"><span class="annottext">noArg :: forall b a. Eq b =&gt; b -&gt; MkOptDescr (a -&gt; b) (b -&gt; a -&gt; a) a
</span><a href="Distribution.Simple.Command.html#noArg"><span class="hs-identifier hs-var hs-var">noArg</span></a></span></span><span> </span><span id="local-6989586621679689517"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679689517"><span class="hs-identifier hs-var">flag</span></a></span></span><span> </span><span id="local-6989586621679689516"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689516"><span class="hs-identifier hs-var">sf</span></a></span></span><span> </span><span id="local-6989586621679689515"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689515"><span class="hs-identifier hs-var">lf</span></a></span></span><span> </span><span id="local-6989586621679689514"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689514"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(b, OptFlags, String)] -&gt; MkOptDescr (a -&gt; b) (b -&gt; a -&gt; a) a
forall b a.
Eq b =&gt;
[(b, OptFlags, String)] -&gt; MkOptDescr (a -&gt; b) (b -&gt; a -&gt; a) a
</span><a href="Distribution.Simple.Command.html#choiceOpt"><span class="hs-identifier hs-var">choiceOpt</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679689517"><span class="hs-identifier hs-var">flag</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689516"><span class="hs-identifier hs-var">sf</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689515"><span class="hs-identifier hs-var">lf</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689514"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689516"><span class="hs-identifier hs-var">sf</span></a></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689515"><span class="hs-identifier hs-var">lf</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689514"><span class="hs-identifier hs-var">d</span></a></span><span>
</span><span id="line-184"></span><span>
</span><span id="line-185"></span><span id="local-6989586621679689786"><span id="local-6989586621679689787"><span class="annot"><a href="Distribution.Simple.Command.html#boolOpt"><span class="hs-identifier hs-type">boolOpt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689787"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689787"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#SFlags"><span class="hs-identifier hs-type">SFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#SFlags"><span class="hs-identifier hs-type">SFlags</span></a></span><span>
</span><span id="line-186"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#MkOptDescr"><span class="hs-identifier hs-type">MkOptDescr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689786"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689787"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689787"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689786"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689786"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679689786"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-187"></span><span id="boolOpt"><span class="annot"><span class="annottext">boolOpt :: forall b a.
(b -&gt; Maybe Bool)
-&gt; (Bool -&gt; b)
-&gt; String
-&gt; String
-&gt; MkOptDescr (a -&gt; b) (b -&gt; a -&gt; a) a
</span><a href="Distribution.Simple.Command.html#boolOpt"><span class="hs-identifier hs-var hs-var">boolOpt</span></a></span></span><span> </span><span id="local-6989586621679689511"><span class="annot"><span class="annottext">b -&gt; Maybe Bool
</span><a href="#local-6989586621679689511"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679689510"><span class="annot"><span class="annottext">Bool -&gt; b
</span><a href="#local-6989586621679689510"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679689509"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689509"><span class="hs-identifier hs-var">sfT</span></a></span></span><span> </span><span id="local-6989586621679689508"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689508"><span class="hs-identifier hs-var">sfF</span></a></span></span><span> </span><span id="local-6989586621679689507"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689507"><span class="hs-identifier hs-var">_sf</span></a></span></span><span> </span><span id="local-6989586621679689506"><span class="annot"><span class="annottext">_lf :: LFlags
</span><a href="#local-6989586621679689506"><span class="hs-identifier hs-var">_lf</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span id="local-6989586621679689505"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689505"><span class="hs-identifier hs-var">n</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span class="annot"><span class="annottext">LFlags
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679689504"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689504"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span id="local-6989586621679689503"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679689503"><span class="hs-identifier hs-var">get</span></a></span></span><span> </span><span id="local-6989586621679689502"><span class="annot"><span class="annottext">b -&gt; a -&gt; a
</span><a href="#local-6989586621679689502"><span class="hs-identifier hs-var">set</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-188"></span><span>    </span><span class="annot"><span class="annottext">String
-&gt; OptFlags
-&gt; OptFlags
-&gt; (Bool -&gt; a -&gt; a)
-&gt; (a -&gt; Maybe Bool)
-&gt; OptDescr a
forall a.
String
-&gt; OptFlags
-&gt; OptFlags
-&gt; (Bool -&gt; a -&gt; a)
-&gt; (a -&gt; Maybe Bool)
-&gt; OptDescr a
</span><a href="Distribution.Simple.Command.html#BoolOpt"><span class="hs-identifier hs-var">BoolOpt</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689504"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689509"><span class="hs-identifier hs-var">sfT</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;enable-&quot;</span></span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689505"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689508"><span class="hs-identifier hs-var">sfF</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;disable-&quot;</span></span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689505"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; a -&gt; a
</span><a href="#local-6989586621679689502"><span class="hs-identifier hs-var">set</span></a></span><span class="annot"><span class="annottext">(b -&gt; a -&gt; a) -&gt; (Bool -&gt; b) -&gt; Bool -&gt; a -&gt; a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span class="annot"><span class="annottext">Bool -&gt; b
</span><a href="#local-6989586621679689510"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; Maybe Bool
</span><a href="#local-6989586621679689511"><span class="hs-identifier hs-var">g</span></a></span><span class="annot"><span class="annottext">(b -&gt; Maybe Bool) -&gt; (a -&gt; b) -&gt; a -&gt; Maybe Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679689503"><span class="hs-identifier hs-var">get</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-189"></span><span class="annot"><a href="Distribution.Simple.Command.html#boolOpt"><span class="hs-identifier hs-var">boolOpt</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; Maybe Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; b
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">b -&gt; a -&gt; a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; OptDescr a
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span>
</span><span id="line-190"></span><span>                            </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Distribution.Simple.Setup.boolOpt: unreachable&quot;</span></span><span>
</span><span id="line-191"></span><span>
</span><span id="line-192"></span><span id="local-6989586621679689782"><span id="local-6989586621679689783"><span class="annot"><a href="Distribution.Simple.Command.html#boolOpt%27"><span class="hs-identifier hs-type">boolOpt'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689783"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689783"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#OptFlags"><span class="hs-identifier hs-type">OptFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#OptFlags"><span class="hs-identifier hs-type">OptFlags</span></a></span><span>
</span><span id="line-193"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#MkOptDescr"><span class="hs-identifier hs-type">MkOptDescr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689782"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689783"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689783"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689782"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689782"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679689782"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-194"></span><span id="boolOpt%27"><span class="annot"><span class="annottext">boolOpt' :: forall b a.
(b -&gt; Maybe Bool)
-&gt; (Bool -&gt; b)
-&gt; OptFlags
-&gt; OptFlags
-&gt; MkOptDescr (a -&gt; b) (b -&gt; a -&gt; a) a
</span><a href="Distribution.Simple.Command.html#boolOpt%27"><span class="hs-identifier hs-var hs-var">boolOpt'</span></a></span></span><span> </span><span id="local-6989586621679689501"><span class="annot"><span class="annottext">b -&gt; Maybe Bool
</span><a href="#local-6989586621679689501"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679689500"><span class="annot"><span class="annottext">Bool -&gt; b
</span><a href="#local-6989586621679689500"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679689499"><span class="annot"><span class="annottext">OptFlags
</span><a href="#local-6989586621679689499"><span class="hs-identifier hs-var">ffT</span></a></span></span><span> </span><span id="local-6989586621679689498"><span class="annot"><span class="annottext">OptFlags
</span><a href="#local-6989586621679689498"><span class="hs-identifier hs-var">ffF</span></a></span></span><span> </span><span id="local-6989586621679689497"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689497"><span class="hs-identifier hs-var">_sf</span></a></span></span><span> </span><span id="local-6989586621679689496"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689496"><span class="hs-identifier hs-var">_lf</span></a></span></span><span> </span><span id="local-6989586621679689495"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689495"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span id="local-6989586621679689494"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679689494"><span class="hs-identifier hs-var">get</span></a></span></span><span> </span><span id="local-6989586621679689493"><span class="annot"><span class="annottext">b -&gt; a -&gt; a
</span><a href="#local-6989586621679689493"><span class="hs-identifier hs-var">set</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
-&gt; OptFlags
-&gt; OptFlags
-&gt; (Bool -&gt; a -&gt; a)
-&gt; (a -&gt; Maybe Bool)
-&gt; OptDescr a
forall a.
String
-&gt; OptFlags
-&gt; OptFlags
-&gt; (Bool -&gt; a -&gt; a)
-&gt; (a -&gt; Maybe Bool)
-&gt; OptDescr a
</span><a href="Distribution.Simple.Command.html#BoolOpt"><span class="hs-identifier hs-var">BoolOpt</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689495"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">OptFlags
</span><a href="#local-6989586621679689499"><span class="hs-identifier hs-var">ffT</span></a></span><span> </span><span class="annot"><span class="annottext">OptFlags
</span><a href="#local-6989586621679689498"><span class="hs-identifier hs-var">ffF</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; a -&gt; a
</span><a href="#local-6989586621679689493"><span class="hs-identifier hs-var">set</span></a></span><span class="annot"><span class="annottext">(b -&gt; a -&gt; a) -&gt; (Bool -&gt; b) -&gt; Bool -&gt; a -&gt; a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span class="annot"><span class="annottext">Bool -&gt; b
</span><a href="#local-6989586621679689500"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; Maybe Bool
</span><a href="#local-6989586621679689501"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">(b -&gt; Maybe Bool) -&gt; (a -&gt; b) -&gt; a -&gt; Maybe Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679689494"><span class="hs-identifier hs-var">get</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-195"></span><span>
</span><span id="line-196"></span><span class="hs-comment">-- | create a Choice option</span><span>
</span><span id="line-197"></span><span id="local-6989586621679689788"><span id="local-6989586621679689789"><span class="annot"><a href="Distribution.Simple.Command.html#choiceOpt"><span class="hs-identifier hs-type">choiceOpt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Eq</span></span><span> </span><span class="annot"><a href="#local-6989586621679689789"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689789"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Distribution.Simple.Command.html#OptFlags"><span class="hs-identifier hs-type">OptFlags</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Distribution.Simple.Command.html#Description"><span class="hs-identifier hs-type">Description</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-198"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#MkOptDescr"><span class="hs-identifier hs-type">MkOptDescr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689788"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689789"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689789"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689788"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689788"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679689788"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-199"></span><span id="choiceOpt"><span class="annot"><span class="annottext">choiceOpt :: forall b a.
Eq b =&gt;
[(b, OptFlags, String)] -&gt; MkOptDescr (a -&gt; b) (b -&gt; a -&gt; a) a
</span><a href="Distribution.Simple.Command.html#choiceOpt"><span class="hs-identifier hs-var hs-var">choiceOpt</span></a></span></span><span> </span><span id="local-6989586621679689491"><span class="annot"><span class="annottext">[(b, OptFlags, String)]
</span><a href="#local-6989586621679689491"><span class="hs-identifier hs-var">aa_ff</span></a></span></span><span> </span><span id="local-6989586621679689490"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689490"><span class="hs-identifier hs-var">_sf</span></a></span></span><span> </span><span id="local-6989586621679689489"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689489"><span class="hs-identifier hs-var">_lf</span></a></span></span><span> </span><span id="local-6989586621679689488"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689488"><span class="hs-identifier hs-var">_d</span></a></span></span><span> </span><span id="local-6989586621679689487"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679689487"><span class="hs-identifier hs-var">get</span></a></span></span><span> </span><span id="local-6989586621679689486"><span class="annot"><span class="annottext">b -&gt; a -&gt; a
</span><a href="#local-6989586621679689486"><span class="hs-identifier hs-var">set</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(String, OptFlags, a -&gt; a, a -&gt; Bool)] -&gt; OptDescr a
forall a. [(String, OptFlags, a -&gt; a, a -&gt; Bool)] -&gt; OptDescr a
</span><a href="Distribution.Simple.Command.html#ChoiceOpt"><span class="hs-identifier hs-var">ChoiceOpt</span></a></span><span> </span><span class="annot"><span class="annottext">[(String, OptFlags, a -&gt; a, a -&gt; Bool)]
</span><a href="#local-6989586621679689485"><span class="hs-identifier hs-var">alts</span></a></span><span>
</span><span id="line-200"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679689485"><span class="annot"><span class="annottext">alts :: [(String, OptFlags, a -&gt; a, a -&gt; Bool)]
</span><a href="#local-6989586621679689485"><span class="hs-identifier hs-var hs-var">alts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689483"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">OptFlags
</span><a href="#local-6989586621679689482"><span class="hs-identifier hs-var">flags</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b -&gt; a -&gt; a
</span><a href="#local-6989586621679689486"><span class="hs-identifier hs-var">set</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679689481"><span class="hs-identifier hs-var">alt</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; b -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679689481"><span class="hs-identifier hs-var">alt</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(b -&gt; Bool) -&gt; (a -&gt; b) -&gt; a -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679689487"><span class="hs-identifier hs-var">get</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679689481"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679689481"><span class="hs-identifier hs-var">alt</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679689482"><span class="annot"><span class="annottext">OptFlags
</span><a href="#local-6989586621679689482"><span class="hs-identifier hs-var">flags</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679689483"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689483"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(b, OptFlags, String)]
</span><a href="#local-6989586621679689491"><span class="hs-identifier hs-var">aa_ff</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-201"></span><span>
</span><span id="line-202"></span><span class="hs-comment">-- | create a Choice option out of an enumeration type.</span><span>
</span><span id="line-203"></span><span class="hs-comment">--   As long flags, the Show output is used. As short flags, the first character</span><span>
</span><span id="line-204"></span><span class="hs-comment">--   which does not conflict with a previous one is used.</span><span>
</span><span id="line-205"></span><span id="local-6989586621679689775"><span id="local-6989586621679689776"><span class="annot"><a href="Distribution.Simple.Command.html#choiceOptFromEnum"><span class="hs-identifier hs-type">choiceOptFromEnum</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Enum.html#Bounded"><span class="hs-identifier hs-type">Bounded</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689776"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Enum.html#Enum"><span class="hs-identifier hs-type">Enum</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689776"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689776"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Eq</span></span><span> </span><span class="annot"><a href="#local-6989586621679689776"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span>
</span><span id="line-206"></span><span>                     </span><span class="annot"><a href="Distribution.Simple.Command.html#MkOptDescr"><span class="hs-identifier hs-type">MkOptDescr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689775"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689776"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689776"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689775"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689775"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679689775"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-207"></span><span id="choiceOptFromEnum"><span class="annot"><span class="annottext">choiceOptFromEnum :: forall b a.
(Bounded b, Enum b, Show b, Eq b) =&gt;
MkOptDescr (a -&gt; b) (b -&gt; a -&gt; a) a
</span><a href="Distribution.Simple.Command.html#choiceOptFromEnum"><span class="hs-identifier hs-var hs-var">choiceOptFromEnum</span></a></span></span><span> </span><span id="local-6989586621679689474"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689474"><span class="hs-identifier hs-var">_sf</span></a></span></span><span> </span><span id="local-6989586621679689473"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689473"><span class="hs-identifier hs-var">_lf</span></a></span></span><span> </span><span id="local-6989586621679689472"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689472"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span id="local-6989586621679689471"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679689471"><span class="hs-identifier hs-var">get</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-208"></span><span>  </span><span class="annot"><span class="annottext">[(b, OptFlags, String)] -&gt; MkOptDescr (a -&gt; b) (b -&gt; a -&gt; a) a
forall b a.
Eq b =&gt;
[(b, OptFlags, String)] -&gt; MkOptDescr (a -&gt; b) (b -&gt; a -&gt; a) a
</span><a href="Distribution.Simple.Command.html#choiceOpt"><span class="hs-identifier hs-var">choiceOpt</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679689470"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689469"><span class="hs-identifier hs-var">sf</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">(Char -&gt; Char) -&gt; String -&gt; String
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char
</span><a href="../../base/src/GHC.Unicode.html#toLower"><span class="hs-identifier hs-var">toLower</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; String -&gt; String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679689470"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689466"><span class="hs-identifier hs-var">d'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-209"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679689470"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679689470"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679689469"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689469"><span class="hs-identifier hs-var">sf</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(b, String)]
</span><a href="#local-6989586621679689465"><span class="hs-identifier hs-var">sflags'</span></a></span><span>
</span><span id="line-210"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679689466"><span class="annot"><span class="annottext">d' :: String
</span><a href="#local-6989586621679689466"><span class="hs-identifier hs-var hs-var">d'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689472"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679689470"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-211"></span><span>  </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689474"><span class="hs-identifier hs-var">_sf</span></a></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689473"><span class="hs-identifier hs-var">_lf</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689472"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679689471"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-212"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679689465"><span class="annot"><span class="annottext">sflags' :: [(b, String)]
</span><a href="#local-6989586621679689465"><span class="hs-identifier hs-var hs-var">sflags'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([(b, String)] -&gt; b -&gt; [(b, String)])
-&gt; [(b, String)] -&gt; [b] -&gt; [(b, String)]
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl"><span class="hs-identifier hs-var">foldl</span></a></span><span> </span><span class="annot"><span class="annottext">[(b, String)] -&gt; b -&gt; [(b, String)]
forall {a}. Show a =&gt; [(a, String)] -&gt; a -&gt; [(a, String)]
</span><a href="#local-6989586621679689458"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679689457"><span class="hs-identifier hs-var">firstOne</span></a></span><span class="hs-glyph">..</span><span class="hs-special">]</span><span>
</span><span id="line-213"></span><span>        </span><span id="local-6989586621679689458"><span class="annot"><span class="annottext">f :: [(a, String)] -&gt; a -&gt; [(a, String)]
</span><a href="#local-6989586621679689458"><span class="hs-identifier hs-var hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679689451"><span class="annot"><span class="annottext">[(a, String)]
</span><a href="#local-6989586621679689451"><span class="hs-identifier hs-var">prev</span></a></span></span><span> </span><span id="local-6989586621679689450"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679689450"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679689448"><span class="annot"><span class="annottext">prevflags :: String
</span><a href="#local-6989586621679689448"><span class="hs-identifier hs-var hs-var">prevflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((a, String) -&gt; String) -&gt; [(a, String)] -&gt; String
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="annot"><span class="annottext">(a, String) -&gt; String
forall a b. (a, b) -&gt; b
</span><a href="../../base/src/Data.Tuple.html#snd"><span class="hs-identifier hs-var">snd</span></a></span><span> </span><span class="annot"><span class="annottext">[(a, String)]
</span><a href="#local-6989586621679689451"><span class="hs-identifier hs-var">prev</span></a></span><span> </span><span class="hs-keyword">in</span><span>
</span><span id="line-214"></span><span>                       </span><span class="annot"><span class="annottext">[(a, String)]
</span><a href="#local-6989586621679689451"><span class="hs-identifier hs-var">prev</span></a></span><span> </span><span class="annot"><span class="annottext">[(a, String)] -&gt; [(a, String)] -&gt; [(a, String)]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; [(a, String)] -&gt; [(a, String)]
forall a. Int -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#take"><span class="hs-identifier hs-var">take</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679689450"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Char -&gt; Char
</span><a href="../../base/src/GHC.Unicode.html#toLower"><span class="hs-identifier hs-var">toLower</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679689445"><span class="hs-identifier hs-var">sf</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-215"></span><span>                                      </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679689445"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679689445"><span class="hs-identifier hs-var">sf</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">a -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679689450"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="../../base/src/GHC.Unicode.html#isAlpha"><span class="hs-identifier hs-var">isAlpha</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679689445"><span class="hs-identifier hs-var">sf</span></a></span><span>
</span><span id="line-216"></span><span>                                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char
</span><a href="../../base/src/GHC.Unicode.html#toLower"><span class="hs-identifier hs-var">toLower</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679689445"><span class="hs-identifier hs-var">sf</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; String -&gt; Bool
forall (t :: * -&gt; *) a. (Foldable t, Eq a) =&gt; a -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#notElem"><span class="hs-operator hs-var">`notElem`</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689448"><span class="hs-identifier hs-var">prevflags</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-217"></span><span>        </span><span id="local-6989586621679689457"><span class="annot"><span class="annottext">firstOne :: b
</span><a href="#local-6989586621679689457"><span class="hs-identifier hs-var hs-var">firstOne</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">b
forall a. Bounded a =&gt; a
</span><a href="../../base/src/GHC.Enum.html#minBound"><span class="hs-identifier hs-var">minBound</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; b -&gt; b
forall a. a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#asTypeOf"><span class="hs-operator hs-var">`asTypeOf`</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679689471"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="annot"><span class="annottext">a
forall a. HasCallStack =&gt; a
</span><a href="../../base/src/GHC.Err.html#undefined"><span class="hs-identifier hs-var">undefined</span></a></span><span>
</span><span id="line-218"></span><span>
</span><span id="line-219"></span><span id="local-6989586621679689753"><span class="annot"><a href="Distribution.Simple.Command.html#commandGetOpts"><span class="hs-identifier hs-type">commandGetOpts</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#ShowOrParseArgs"><span class="hs-identifier hs-type">ShowOrParseArgs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#CommandUI"><span class="hs-identifier hs-type">CommandUI</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689753"><span class="hs-identifier hs-type">flags</span></a></span><span>
</span><span id="line-220"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/System.Console.GetOpt.html#OptDescr"><span class="hs-identifier hs-type">GetOpt.OptDescr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689753"><span class="hs-identifier hs-type">flags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689753"><span class="hs-identifier hs-type">flags</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span></span><span>
</span><span id="line-221"></span><span id="commandGetOpts"><span class="annot"><span class="annottext">commandGetOpts :: forall flags.
ShowOrParseArgs -&gt; CommandUI flags -&gt; [OptDescr (flags -&gt; flags)]
</span><a href="Distribution.Simple.Command.html#commandGetOpts"><span class="hs-identifier hs-var hs-var">commandGetOpts</span></a></span></span><span> </span><span id="local-6989586621679689434"><span class="annot"><span class="annottext">ShowOrParseArgs
</span><a href="#local-6989586621679689434"><span class="hs-identifier hs-var">showOrParse</span></a></span></span><span> </span><span id="local-6989586621679689433"><span class="annot"><span class="annottext">CommandUI flags
</span><a href="#local-6989586621679689433"><span class="hs-identifier hs-var">command</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-222"></span><span>    </span><span class="annot"><span class="annottext">(OptionField flags -&gt; [OptDescr (flags -&gt; flags)])
-&gt; [OptionField flags] -&gt; [OptDescr (flags -&gt; flags)]
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="annot"><span class="annottext">OptionField flags -&gt; [OptDescr (flags -&gt; flags)]
forall a. OptionField a -&gt; [OptDescr (a -&gt; a)]
</span><a href="Distribution.Simple.Command.html#viewAsGetOpt"><span class="hs-identifier hs-var">viewAsGetOpt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CommandUI flags -&gt; ShowOrParseArgs -&gt; [OptionField flags]
forall flags.
CommandUI flags -&gt; ShowOrParseArgs -&gt; [OptionField flags]
</span><a href="Distribution.Simple.Command.html#commandOptions"><span class="hs-identifier hs-var hs-var">commandOptions</span></a></span><span> </span><span class="annot"><span class="annottext">CommandUI flags
</span><a href="#local-6989586621679689433"><span class="hs-identifier hs-var">command</span></a></span><span> </span><span class="annot"><span class="annottext">ShowOrParseArgs
</span><a href="#local-6989586621679689434"><span class="hs-identifier hs-var">showOrParse</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-223"></span><span>
</span><span id="line-224"></span><span id="local-6989586621679689750"><span class="annot"><a href="Distribution.Simple.Command.html#viewAsGetOpt"><span class="hs-identifier hs-type">viewAsGetOpt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#OptionField"><span class="hs-identifier hs-type">OptionField</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689750"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/System.Console.GetOpt.html#OptDescr"><span class="hs-identifier hs-type">GetOpt.OptDescr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689750"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-glyph">-&gt;</span><span class="annot"><a href="#local-6989586621679689750"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span></span><span>
</span><span id="line-225"></span><span id="viewAsGetOpt"><span class="annot"><span class="annottext">viewAsGetOpt :: forall a. OptionField a -&gt; [OptDescr (a -&gt; a)]
</span><a href="Distribution.Simple.Command.html#viewAsGetOpt"><span class="hs-identifier hs-var hs-var">viewAsGetOpt</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Command.html#OptionField"><span class="hs-identifier hs-type">OptionField</span></a></span><span> </span><span id="local-6989586621679689430"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689430"><span class="hs-identifier hs-var">_n</span></a></span></span><span> </span><span id="local-6989586621679689429"><span class="annot"><span class="annottext">[OptDescr a]
</span><a href="#local-6989586621679689429"><span class="hs-identifier hs-var">aa</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(OptDescr a -&gt; [OptDescr (a -&gt; a)])
-&gt; [OptDescr a] -&gt; [OptDescr (a -&gt; a)]
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="annot"><span class="annottext">OptDescr a -&gt; [OptDescr (a -&gt; a)]
forall {a}. OptDescr a -&gt; [OptDescr (a -&gt; a)]
</span><a href="#local-6989586621679689428"><span class="hs-identifier hs-var">optDescrToGetOpt</span></a></span><span> </span><span class="annot"><span class="annottext">[OptDescr a]
</span><a href="#local-6989586621679689429"><span class="hs-identifier hs-var">aa</span></a></span><span>
</span><span id="line-226"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-227"></span><span>    </span><span id="local-6989586621679689428"><span class="annot"><span class="annottext">optDescrToGetOpt :: OptDescr a -&gt; [OptDescr (a -&gt; a)]
</span><a href="#local-6989586621679689428"><span class="hs-identifier hs-var hs-var">optDescrToGetOpt</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Command.html#ReqArg"><span class="hs-identifier hs-type">ReqArg</span></a></span><span> </span><span id="local-6989586621679689427"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689427"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679689426"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689426"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679689425"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689425"><span class="hs-identifier hs-var">ss</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679689424"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689424"><span class="hs-identifier hs-var">arg_desc</span></a></span></span><span> </span><span id="local-6989586621679689423"><span class="annot"><span class="annottext">ReadE (a -&gt; a)
</span><a href="#local-6989586621679689423"><span class="hs-identifier hs-var">set</span></a></span></span><span> </span><span class="annot"><span class="annottext">a -&gt; LFlags
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-228"></span><span>         </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String
-&gt; LFlags -&gt; ArgDescr (a -&gt; a) -&gt; String -&gt; OptDescr (a -&gt; a)
forall a. String -&gt; LFlags -&gt; ArgDescr a -&gt; String -&gt; OptDescr a
</span><a href="../../base/src/System.Console.GetOpt.html#Option"><span class="hs-identifier hs-var">GetOpt.Option</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689426"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689425"><span class="hs-identifier hs-var">ss</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(String -&gt; a -&gt; a) -&gt; String -&gt; ArgDescr (a -&gt; a)
forall a. (String -&gt; a) -&gt; String -&gt; ArgDescr a
</span><a href="../../base/src/System.Console.GetOpt.html#ReqArg"><span class="hs-identifier hs-var">GetOpt.ReqArg</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; a -&gt; a
</span><a href="#local-6989586621679689420"><span class="hs-identifier hs-var">set'</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689424"><span class="hs-identifier hs-var">arg_desc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689427"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-229"></span><span>             </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679689420"><span class="annot"><span class="annottext">set' :: String -&gt; a -&gt; a
</span><a href="#local-6989586621679689420"><span class="hs-identifier hs-var hs-var">set'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadE (a -&gt; a) -&gt; String -&gt; a -&gt; a
forall a. ReadE a -&gt; String -&gt; a
</span><a href="Distribution.ReadE.html#readEOrFail"><span class="hs-identifier hs-var">readEOrFail</span></a></span><span> </span><span class="annot"><span class="annottext">ReadE (a -&gt; a)
</span><a href="#local-6989586621679689423"><span class="hs-identifier hs-var">set</span></a></span><span>
</span><span id="line-230"></span><span>    </span><span class="annot"><a href="#local-6989586621679689428"><span class="hs-identifier hs-var">optDescrToGetOpt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Command.html#OptArg"><span class="hs-identifier hs-type">OptArg</span></a></span><span> </span><span id="local-6989586621679689418"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689418"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679689417"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689417"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679689416"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689416"><span class="hs-identifier hs-var">ss</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679689415"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689415"><span class="hs-identifier hs-var">arg_desc</span></a></span></span><span> </span><span id="local-6989586621679689414"><span class="annot"><span class="annottext">ReadE (a -&gt; a)
</span><a href="#local-6989586621679689414"><span class="hs-identifier hs-var">set</span></a></span></span><span> </span><span id="local-6989586621679689413"><span class="annot"><span class="annottext">a -&gt; a
</span><a href="#local-6989586621679689413"><span class="hs-identifier hs-var">def</span></a></span></span><span> </span><span class="annot"><span class="annottext">a -&gt; [Maybe String]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-231"></span><span>         </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String
-&gt; LFlags -&gt; ArgDescr (a -&gt; a) -&gt; String -&gt; OptDescr (a -&gt; a)
forall a. String -&gt; LFlags -&gt; ArgDescr a -&gt; String -&gt; OptDescr a
</span><a href="../../base/src/System.Console.GetOpt.html#Option"><span class="hs-identifier hs-var">GetOpt.Option</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689417"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689416"><span class="hs-identifier hs-var">ss</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Maybe String -&gt; a -&gt; a) -&gt; String -&gt; ArgDescr (a -&gt; a)
forall a. (Maybe String -&gt; a) -&gt; String -&gt; ArgDescr a
</span><a href="../../base/src/System.Console.GetOpt.html#OptArg"><span class="hs-identifier hs-var">GetOpt.OptArg</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe String -&gt; a -&gt; a
</span><a href="#local-6989586621679689411"><span class="hs-identifier hs-var">set'</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689415"><span class="hs-identifier hs-var">arg_desc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689418"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-232"></span><span>             </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679689411"><span class="annot"><span class="annottext">set' :: Maybe String -&gt; a -&gt; a
</span><a href="#local-6989586621679689411"><span class="hs-identifier hs-var hs-var">set'</span></a></span></span><span> </span><span class="annot"><span class="annottext">Maybe String
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; a
</span><a href="#local-6989586621679689413"><span class="hs-identifier hs-var">def</span></a></span><span>
</span><span id="line-233"></span><span>                   </span><span class="annot"><a href="#local-6989586621679689411"><span class="hs-identifier hs-var">set'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679689410"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689410"><span class="hs-identifier hs-var">txt</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadE (a -&gt; a) -&gt; String -&gt; a -&gt; a
forall a. ReadE a -&gt; String -&gt; a
</span><a href="Distribution.ReadE.html#readEOrFail"><span class="hs-identifier hs-var">readEOrFail</span></a></span><span> </span><span class="annot"><span class="annottext">ReadE (a -&gt; a)
</span><a href="#local-6989586621679689414"><span class="hs-identifier hs-var">set</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689410"><span class="hs-identifier hs-var">txt</span></a></span><span>
</span><span id="line-234"></span><span>    </span><span class="annot"><a href="#local-6989586621679689428"><span class="hs-identifier hs-var">optDescrToGetOpt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Command.html#ChoiceOpt"><span class="hs-identifier hs-type">ChoiceOpt</span></a></span><span> </span><span id="local-6989586621679689409"><span class="annot"><span class="annottext">[(String, OptFlags, a -&gt; a, a -&gt; Bool)]
</span><a href="#local-6989586621679689409"><span class="hs-identifier hs-var">alts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-235"></span><span>         </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String
-&gt; LFlags -&gt; ArgDescr (a -&gt; a) -&gt; String -&gt; OptDescr (a -&gt; a)
forall a. String -&gt; LFlags -&gt; ArgDescr a -&gt; String -&gt; OptDescr a
</span><a href="../../base/src/System.Console.GetOpt.html#Option"><span class="hs-identifier hs-var">GetOpt.Option</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689408"><span class="hs-identifier hs-var">sf</span></a></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689407"><span class="hs-identifier hs-var">lf</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; a) -&gt; ArgDescr (a -&gt; a)
forall a. a -&gt; ArgDescr a
</span><a href="../../base/src/System.Console.GetOpt.html#NoArg"><span class="hs-identifier hs-var">GetOpt.NoArg</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a
</span><a href="#local-6989586621679689405"><span class="hs-identifier hs-var">set</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689404"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679689404"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689404"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">,</span><span class="hs-special">(</span><span id="local-6989586621679689408"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689408"><span class="hs-identifier hs-var">sf</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679689407"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689407"><span class="hs-identifier hs-var">lf</span></a></span></span><span class="hs-special">)</span><span class="hs-special">,</span><span id="local-6989586621679689405"><span class="annot"><span class="annottext">a -&gt; a
</span><a href="#local-6989586621679689405"><span class="hs-identifier hs-var">set</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">a -&gt; Bool
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(String, OptFlags, a -&gt; a, a -&gt; Bool)]
</span><a href="#local-6989586621679689409"><span class="hs-identifier hs-var">alts</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-236"></span><span>    </span><span class="annot"><a href="#local-6989586621679689428"><span class="hs-identifier hs-var">optDescrToGetOpt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Command.html#BoolOpt"><span class="hs-identifier hs-type">BoolOpt</span></a></span><span> </span><span id="local-6989586621679689403"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689403"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679689402"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689402"><span class="hs-identifier hs-var">sfT</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679689401"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689401"><span class="hs-identifier hs-var">lfT</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span>  </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>  </span><span id="local-6989586621679689400"><span class="annot"><span class="annottext">Bool -&gt; a -&gt; a
</span><a href="#local-6989586621679689400"><span class="hs-identifier hs-var">set</span></a></span></span><span> </span><span class="annot"><span class="annottext">a -&gt; Maybe Bool
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-237"></span><span>         </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String
-&gt; LFlags -&gt; ArgDescr (a -&gt; a) -&gt; String -&gt; OptDescr (a -&gt; a)
forall a. String -&gt; LFlags -&gt; ArgDescr a -&gt; String -&gt; OptDescr a
</span><a href="../../base/src/System.Console.GetOpt.html#Option"><span class="hs-identifier hs-var">GetOpt.Option</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689402"><span class="hs-identifier hs-var">sfT</span></a></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689401"><span class="hs-identifier hs-var">lfT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; a) -&gt; ArgDescr (a -&gt; a)
forall a. a -&gt; ArgDescr a
</span><a href="../../base/src/System.Console.GetOpt.html#NoArg"><span class="hs-identifier hs-var">GetOpt.NoArg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; a -&gt; a
</span><a href="#local-6989586621679689400"><span class="hs-identifier hs-var">set</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>  </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689403"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-238"></span><span>    </span><span class="annot"><a href="#local-6989586621679689428"><span class="hs-identifier hs-var">optDescrToGetOpt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Command.html#BoolOpt"><span class="hs-identifier hs-type">BoolOpt</span></a></span><span> </span><span id="local-6989586621679689399"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689399"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span>  </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>  </span><span class="hs-special">(</span><span id="local-6989586621679689398"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689398"><span class="hs-identifier hs-var">sfF</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679689397"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689397"><span class="hs-identifier hs-var">lfF</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679689396"><span class="annot"><span class="annottext">Bool -&gt; a -&gt; a
</span><a href="#local-6989586621679689396"><span class="hs-identifier hs-var">set</span></a></span></span><span> </span><span class="annot"><span class="annottext">a -&gt; Maybe Bool
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-239"></span><span>         </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String
-&gt; LFlags -&gt; ArgDescr (a -&gt; a) -&gt; String -&gt; OptDescr (a -&gt; a)
forall a. String -&gt; LFlags -&gt; ArgDescr a -&gt; String -&gt; OptDescr a
</span><a href="../../base/src/System.Console.GetOpt.html#Option"><span class="hs-identifier hs-var">GetOpt.Option</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689398"><span class="hs-identifier hs-var">sfF</span></a></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689397"><span class="hs-identifier hs-var">lfF</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; a) -&gt; ArgDescr (a -&gt; a)
forall a. a -&gt; ArgDescr a
</span><a href="../../base/src/System.Console.GetOpt.html#NoArg"><span class="hs-identifier hs-var">GetOpt.NoArg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; a -&gt; a
</span><a href="#local-6989586621679689396"><span class="hs-identifier hs-var">set</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689399"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-240"></span><span>    </span><span class="annot"><a href="#local-6989586621679689428"><span class="hs-identifier hs-var">optDescrToGetOpt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Command.html#BoolOpt"><span class="hs-identifier hs-type">BoolOpt</span></a></span><span> </span><span id="local-6989586621679689395"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689395"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679689394"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689394"><span class="hs-identifier hs-var">sfT</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679689393"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689393"><span class="hs-identifier hs-var">lfT</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-special">(</span><span id="local-6989586621679689392"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689392"><span class="hs-identifier hs-var">sfF</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679689391"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689391"><span class="hs-identifier hs-var">lfF</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679689390"><span class="annot"><span class="annottext">Bool -&gt; a -&gt; a
</span><a href="#local-6989586621679689390"><span class="hs-identifier hs-var">set</span></a></span></span><span> </span><span class="annot"><span class="annottext">a -&gt; Maybe Bool
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-241"></span><span>         </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String
-&gt; LFlags -&gt; ArgDescr (a -&gt; a) -&gt; String -&gt; OptDescr (a -&gt; a)
forall a. String -&gt; LFlags -&gt; ArgDescr a -&gt; String -&gt; OptDescr a
</span><a href="../../base/src/System.Console.GetOpt.html#Option"><span class="hs-identifier hs-var">GetOpt.Option</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689394"><span class="hs-identifier hs-var">sfT</span></a></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689393"><span class="hs-identifier hs-var">lfT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; a) -&gt; ArgDescr (a -&gt; a)
forall a. a -&gt; ArgDescr a
</span><a href="../../base/src/System.Console.GetOpt.html#NoArg"><span class="hs-identifier hs-var">GetOpt.NoArg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; a -&gt; a
</span><a href="#local-6989586621679689390"><span class="hs-identifier hs-var">set</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Enable &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689395"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-242"></span><span>         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
-&gt; LFlags -&gt; ArgDescr (a -&gt; a) -&gt; String -&gt; OptDescr (a -&gt; a)
forall a. String -&gt; LFlags -&gt; ArgDescr a -&gt; String -&gt; OptDescr a
</span><a href="../../base/src/System.Console.GetOpt.html#Option"><span class="hs-identifier hs-var">GetOpt.Option</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689392"><span class="hs-identifier hs-var">sfF</span></a></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689391"><span class="hs-identifier hs-var">lfF</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; a) -&gt; ArgDescr (a -&gt; a)
forall a. a -&gt; ArgDescr a
</span><a href="../../base/src/System.Console.GetOpt.html#NoArg"><span class="hs-identifier hs-var">GetOpt.NoArg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; a -&gt; a
</span><a href="#local-6989586621679689390"><span class="hs-identifier hs-var">set</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Disable &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689395"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-243"></span><span>
</span><span id="line-244"></span><span id="local-6989586621679689743"><span class="annot"><a href="Distribution.Simple.Command.html#getCurrentChoice"><span class="hs-identifier hs-type">getCurrentChoice</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#OptDescr"><span class="hs-identifier hs-type">OptDescr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689743"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689743"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-245"></span><span id="getCurrentChoice"><span class="annot"><span class="annottext">getCurrentChoice :: forall a. OptDescr a -&gt; a -&gt; LFlags
</span><a href="Distribution.Simple.Command.html#getCurrentChoice"><span class="hs-identifier hs-var hs-var">getCurrentChoice</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Command.html#ChoiceOpt"><span class="hs-identifier hs-type">ChoiceOpt</span></a></span><span> </span><span id="local-6989586621679689386"><span class="annot"><span class="annottext">[(String, OptFlags, a -&gt; a, a -&gt; Bool)]
</span><a href="#local-6989586621679689386"><span class="hs-identifier hs-var">alts</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679689385"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679689385"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-246"></span><span>    </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689384"><span class="hs-identifier hs-var">lf</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span class="hs-special">(</span><span id="local-6989586621679689383"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689383"><span class="hs-identifier hs-var">_sf</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679689384"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689384"><span class="hs-identifier hs-var">lf</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span class="annot"><span class="annottext">LFlags
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">a -&gt; a
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679689382"><span class="annot"><span class="annottext">a -&gt; Bool
</span><a href="#local-6989586621679689382"><span class="hs-identifier hs-var">currentChoice</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(String, OptFlags, a -&gt; a, a -&gt; Bool)]
</span><a href="#local-6989586621679689386"><span class="hs-identifier hs-var">alts</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">a -&gt; Bool
</span><a href="#local-6989586621679689382"><span class="hs-identifier hs-var">currentChoice</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679689385"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-247"></span><span>
</span><span id="line-248"></span><span class="annot"><a href="Distribution.Simple.Command.html#getCurrentChoice"><span class="hs-identifier hs-var">getCurrentChoice</span></a></span><span> </span><span class="annot"><span class="annottext">OptDescr a
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; LFlags
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Command.getChoice: expected a Choice OptDescr&quot;</span></span><span>
</span><span id="line-249"></span><span>
</span><span id="line-250"></span><span>
</span><span id="line-251"></span><span id="local-6989586621679689740"><span id="local-6989586621679689741"><span class="annot"><a href="Distribution.Simple.Command.html#liftOption"><span class="hs-identifier hs-type">liftOption</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689741"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689740"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689740"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689741"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689741"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#OptionField"><span class="hs-identifier hs-type">OptionField</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689740"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#OptionField"><span class="hs-identifier hs-type">OptionField</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689741"><span class="hs-identifier hs-type">b</span></a></span></span></span><span>
</span><span id="line-252"></span><span id="liftOption"><span class="annot"><span class="annottext">liftOption :: forall b a.
(b -&gt; a) -&gt; (a -&gt; b -&gt; b) -&gt; OptionField a -&gt; OptionField b
</span><a href="Distribution.Simple.Command.html#liftOption"><span class="hs-identifier hs-var hs-var">liftOption</span></a></span></span><span> </span><span id="local-6989586621679689381"><span class="annot"><span class="annottext">b -&gt; a
</span><a href="#local-6989586621679689381"><span class="hs-identifier hs-var">get'</span></a></span></span><span> </span><span id="local-6989586621679689380"><span class="annot"><span class="annottext">a -&gt; b -&gt; b
</span><a href="#local-6989586621679689380"><span class="hs-identifier hs-var">set'</span></a></span></span><span> </span><span id="local-6989586621679689379"><span class="annot"><span class="annottext">OptionField a
</span><a href="#local-6989586621679689379"><span class="hs-identifier hs-var">opt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-253"></span><span>  </span><span class="annot"><span class="annottext">OptionField a
</span><a href="#local-6989586621679689379"><span class="hs-identifier hs-var">opt</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">optionDescr :: [OptDescr b]
</span><a href="Distribution.Simple.Command.html#optionDescr"><span class="hs-identifier hs-var">optionDescr</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(b -&gt; a) -&gt; (a -&gt; b -&gt; b) -&gt; OptDescr a -&gt; OptDescr b
forall b a. (b -&gt; a) -&gt; (a -&gt; b -&gt; b) -&gt; OptDescr a -&gt; OptDescr b
</span><a href="Distribution.Simple.Command.html#liftOptDescr"><span class="hs-identifier hs-var">liftOptDescr</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; a
</span><a href="#local-6989586621679689381"><span class="hs-identifier hs-var">get'</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b -&gt; b
</span><a href="#local-6989586621679689380"><span class="hs-identifier hs-var">set'</span></a></span><span> </span><span class="annot"><span class="annottext">(OptDescr a -&gt; OptDescr b) -&gt; [OptDescr a] -&gt; [OptDescr b]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-operator hs-var">`map`</span></a></span><span> </span><span class="annot"><span class="annottext">OptionField a -&gt; [OptDescr a]
forall a. OptionField a -&gt; [OptDescr a]
</span><a href="Distribution.Simple.Command.html#optionDescr"><span class="hs-identifier hs-var hs-var">optionDescr</span></a></span><span> </span><span class="annot"><span class="annottext">OptionField a
</span><a href="#local-6989586621679689379"><span class="hs-identifier hs-var">opt</span></a></span><span class="hs-special">}</span><span>
</span><span id="line-254"></span><span>
</span><span id="line-255"></span><span class="hs-comment">-- | @since 3.4.0.0</span><span>
</span><span id="line-256"></span><span id="local-6989586621679689734"><span id="local-6989586621679689735"><span class="annot"><a href="Distribution.Simple.Command.html#liftOptionL"><span class="hs-identifier hs-type">liftOptionL</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Compat.Lens.html#ALens%27"><span class="hs-identifier hs-type">ALens'</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689735"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689734"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#OptionField"><span class="hs-identifier hs-type">OptionField</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689734"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#OptionField"><span class="hs-identifier hs-type">OptionField</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689735"><span class="hs-identifier hs-type">b</span></a></span></span></span><span>
</span><span id="line-257"></span><span id="liftOptionL"><span class="annot"><span class="annottext">liftOptionL :: forall b a. ALens' b a -&gt; OptionField a -&gt; OptionField b
</span><a href="Distribution.Simple.Command.html#liftOptionL"><span class="hs-identifier hs-var hs-var">liftOptionL</span></a></span></span><span> </span><span id="local-6989586621679689377"><span class="annot"><span class="annottext">ALens' b a
</span><a href="#local-6989586621679689377"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(b -&gt; a) -&gt; (a -&gt; b -&gt; b) -&gt; OptionField a -&gt; OptionField b
forall b a.
(b -&gt; a) -&gt; (a -&gt; b -&gt; b) -&gt; OptionField a -&gt; OptionField b
</span><a href="Distribution.Simple.Command.html#liftOption"><span class="hs-identifier hs-var">liftOption</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; ALens' b a -&gt; a
forall s t a b. s -&gt; ALens s t a b -&gt; a
</span><a href="Distribution.Compat.Lens.html#%5E%23"><span class="hs-operator hs-var">^#</span></a></span><span> </span><span class="annot"><span class="annottext">ALens' b a
</span><a href="#local-6989586621679689377"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ALens' b a
</span><a href="#local-6989586621679689377"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">ALens' b a -&gt; a -&gt; b -&gt; b
forall s t a b. ALens s t a b -&gt; b -&gt; s -&gt; t
</span><a href="Distribution.Compat.Lens.html#%23~"><span class="hs-operator hs-var">#~</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-258"></span><span>
</span><span id="line-259"></span><span>
</span><span id="line-260"></span><span id="local-6989586621679689736"><span id="local-6989586621679689737"><span class="annot"><a href="Distribution.Simple.Command.html#liftOptDescr"><span class="hs-identifier hs-type">liftOptDescr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689737"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689736"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689736"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689737"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689737"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#OptDescr"><span class="hs-identifier hs-type">OptDescr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689736"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#OptDescr"><span class="hs-identifier hs-type">OptDescr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689737"><span class="hs-identifier hs-type">b</span></a></span></span></span><span>
</span><span id="line-261"></span><span id="liftOptDescr"><span class="annot"><span class="annottext">liftOptDescr :: forall b a. (b -&gt; a) -&gt; (a -&gt; b -&gt; b) -&gt; OptDescr a -&gt; OptDescr b
</span><a href="Distribution.Simple.Command.html#liftOptDescr"><span class="hs-identifier hs-var hs-var">liftOptDescr</span></a></span></span><span> </span><span id="local-6989586621679689374"><span class="annot"><span class="annottext">b -&gt; a
</span><a href="#local-6989586621679689374"><span class="hs-identifier hs-var">get'</span></a></span></span><span> </span><span id="local-6989586621679689373"><span class="annot"><span class="annottext">a -&gt; b -&gt; b
</span><a href="#local-6989586621679689373"><span class="hs-identifier hs-var">set'</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Command.html#ChoiceOpt"><span class="hs-identifier hs-type">ChoiceOpt</span></a></span><span> </span><span id="local-6989586621679689372"><span class="annot"><span class="annottext">[(String, OptFlags, a -&gt; a, a -&gt; Bool)]
</span><a href="#local-6989586621679689372"><span class="hs-identifier hs-var">opts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-262"></span><span>    </span><span class="annot"><span class="annottext">[(String, OptFlags, b -&gt; b, b -&gt; Bool)] -&gt; OptDescr b
forall a. [(String, OptFlags, a -&gt; a, a -&gt; Bool)] -&gt; OptDescr a
</span><a href="Distribution.Simple.Command.html#ChoiceOpt"><span class="hs-identifier hs-var">ChoiceOpt</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689371"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">OptFlags
</span><a href="#local-6989586621679689370"><span class="hs-identifier hs-var">ff</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(b -&gt; a) -&gt; (a -&gt; b -&gt; b) -&gt; (a -&gt; a) -&gt; b -&gt; b
forall b a. (b -&gt; a) -&gt; (a -&gt; b -&gt; b) -&gt; (a -&gt; a) -&gt; b -&gt; b
</span><a href="Distribution.Simple.Command.html#liftSet"><span class="hs-identifier hs-var">liftSet</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; a
</span><a href="#local-6989586621679689374"><span class="hs-identifier hs-var">get'</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b -&gt; b
</span><a href="#local-6989586621679689373"><span class="hs-identifier hs-var">set'</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a
</span><a href="#local-6989586621679689368"><span class="hs-identifier hs-var">set</span></a></span><span> </span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; Bool
</span><a href="#local-6989586621679689367"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; Bool) -&gt; (b -&gt; a) -&gt; b -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; a
</span><a href="#local-6989586621679689374"><span class="hs-identifier hs-var">get'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-263"></span><span>              </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679689371"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689371"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679689370"><span class="annot"><span class="annottext">OptFlags
</span><a href="#local-6989586621679689370"><span class="hs-identifier hs-var">ff</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679689368"><span class="annot"><span class="annottext">a -&gt; a
</span><a href="#local-6989586621679689368"><span class="hs-identifier hs-var">set</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679689367"><span class="annot"><span class="annottext">a -&gt; Bool
</span><a href="#local-6989586621679689367"><span class="hs-identifier hs-var">get</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(String, OptFlags, a -&gt; a, a -&gt; Bool)]
</span><a href="#local-6989586621679689372"><span class="hs-identifier hs-var">opts</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-264"></span><span>
</span><span id="line-265"></span><span class="annot"><a href="Distribution.Simple.Command.html#liftOptDescr"><span class="hs-identifier hs-var">liftOptDescr</span></a></span><span> </span><span id="local-6989586621679689366"><span class="annot"><span class="annottext">b -&gt; a
</span><a href="#local-6989586621679689366"><span class="hs-identifier hs-var">get'</span></a></span></span><span> </span><span id="local-6989586621679689365"><span class="annot"><span class="annottext">a -&gt; b -&gt; b
</span><a href="#local-6989586621679689365"><span class="hs-identifier hs-var">set'</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Command.html#OptArg"><span class="hs-identifier hs-type">OptArg</span></a></span><span> </span><span id="local-6989586621679689364"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689364"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span id="local-6989586621679689363"><span class="annot"><span class="annottext">OptFlags
</span><a href="#local-6989586621679689363"><span class="hs-identifier hs-var">ff</span></a></span></span><span> </span><span id="local-6989586621679689362"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689362"><span class="hs-identifier hs-var">ad</span></a></span></span><span> </span><span id="local-6989586621679689361"><span class="annot"><span class="annottext">ReadE (a -&gt; a)
</span><a href="#local-6989586621679689361"><span class="hs-identifier hs-var">set</span></a></span></span><span> </span><span id="local-6989586621679689360"><span class="annot"><span class="annottext">a -&gt; a
</span><a href="#local-6989586621679689360"><span class="hs-identifier hs-var">def</span></a></span></span><span> </span><span id="local-6989586621679689359"><span class="annot"><span class="annottext">a -&gt; [Maybe String]
</span><a href="#local-6989586621679689359"><span class="hs-identifier hs-var">get</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-266"></span><span>    </span><span class="annot"><span class="annottext">String
-&gt; OptFlags
-&gt; String
-&gt; ReadE (b -&gt; b)
-&gt; (b -&gt; b)
-&gt; (b -&gt; [Maybe String])
-&gt; OptDescr b
forall a.
String
-&gt; OptFlags
-&gt; String
-&gt; ReadE (a -&gt; a)
-&gt; (a -&gt; a)
-&gt; (a -&gt; [Maybe String])
-&gt; OptDescr a
</span><a href="Distribution.Simple.Command.html#OptArg"><span class="hs-identifier hs-var">OptArg</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689364"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">OptFlags
</span><a href="#local-6989586621679689363"><span class="hs-identifier hs-var">ff</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689362"><span class="hs-identifier hs-var">ad</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(b -&gt; a) -&gt; (a -&gt; b -&gt; b) -&gt; (a -&gt; a) -&gt; b -&gt; b
forall b a. (b -&gt; a) -&gt; (a -&gt; b -&gt; b) -&gt; (a -&gt; a) -&gt; b -&gt; b
</span><a href="Distribution.Simple.Command.html#liftSet"><span class="hs-identifier hs-var">liftSet</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; a
</span><a href="#local-6989586621679689366"><span class="hs-identifier hs-var">get'</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b -&gt; b
</span><a href="#local-6989586621679689365"><span class="hs-identifier hs-var">set'</span></a></span><span> </span><span class="annot"><span class="annottext">((a -&gt; a) -&gt; b -&gt; b) -&gt; ReadE (a -&gt; a) -&gt; ReadE (b -&gt; b)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-operator hs-var">`fmap`</span></a></span><span> </span><span class="annot"><span class="annottext">ReadE (a -&gt; a)
</span><a href="#local-6989586621679689361"><span class="hs-identifier hs-var">set</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-267"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(b -&gt; a) -&gt; (a -&gt; b -&gt; b) -&gt; (a -&gt; a) -&gt; b -&gt; b
forall b a. (b -&gt; a) -&gt; (a -&gt; b -&gt; b) -&gt; (a -&gt; a) -&gt; b -&gt; b
</span><a href="Distribution.Simple.Command.html#liftSet"><span class="hs-identifier hs-var">liftSet</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; a
</span><a href="#local-6989586621679689366"><span class="hs-identifier hs-var">get'</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b -&gt; b
</span><a href="#local-6989586621679689365"><span class="hs-identifier hs-var">set'</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a
</span><a href="#local-6989586621679689360"><span class="hs-identifier hs-var">def</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; [Maybe String]
</span><a href="#local-6989586621679689359"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; [Maybe String]) -&gt; (b -&gt; a) -&gt; b -&gt; [Maybe String]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; a
</span><a href="#local-6989586621679689366"><span class="hs-identifier hs-var">get'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-268"></span><span>
</span><span id="line-269"></span><span class="annot"><a href="Distribution.Simple.Command.html#liftOptDescr"><span class="hs-identifier hs-var">liftOptDescr</span></a></span><span> </span><span id="local-6989586621679689358"><span class="annot"><span class="annottext">b -&gt; a
</span><a href="#local-6989586621679689358"><span class="hs-identifier hs-var">get'</span></a></span></span><span> </span><span id="local-6989586621679689357"><span class="annot"><span class="annottext">a -&gt; b -&gt; b
</span><a href="#local-6989586621679689357"><span class="hs-identifier hs-var">set'</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Command.html#ReqArg"><span class="hs-identifier hs-type">ReqArg</span></a></span><span> </span><span id="local-6989586621679689356"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689356"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span id="local-6989586621679689355"><span class="annot"><span class="annottext">OptFlags
</span><a href="#local-6989586621679689355"><span class="hs-identifier hs-var">ff</span></a></span></span><span> </span><span id="local-6989586621679689354"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689354"><span class="hs-identifier hs-var">ad</span></a></span></span><span> </span><span id="local-6989586621679689353"><span class="annot"><span class="annottext">ReadE (a -&gt; a)
</span><a href="#local-6989586621679689353"><span class="hs-identifier hs-var">set</span></a></span></span><span> </span><span id="local-6989586621679689352"><span class="annot"><span class="annottext">a -&gt; LFlags
</span><a href="#local-6989586621679689352"><span class="hs-identifier hs-var">get</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-270"></span><span>    </span><span class="annot"><span class="annottext">String
-&gt; OptFlags
-&gt; String
-&gt; ReadE (b -&gt; b)
-&gt; (b -&gt; LFlags)
-&gt; OptDescr b
forall a.
String
-&gt; OptFlags
-&gt; String
-&gt; ReadE (a -&gt; a)
-&gt; (a -&gt; LFlags)
-&gt; OptDescr a
</span><a href="Distribution.Simple.Command.html#ReqArg"><span class="hs-identifier hs-var">ReqArg</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689356"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">OptFlags
</span><a href="#local-6989586621679689355"><span class="hs-identifier hs-var">ff</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689354"><span class="hs-identifier hs-var">ad</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(b -&gt; a) -&gt; (a -&gt; b -&gt; b) -&gt; (a -&gt; a) -&gt; b -&gt; b
forall b a. (b -&gt; a) -&gt; (a -&gt; b -&gt; b) -&gt; (a -&gt; a) -&gt; b -&gt; b
</span><a href="Distribution.Simple.Command.html#liftSet"><span class="hs-identifier hs-var">liftSet</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; a
</span><a href="#local-6989586621679689358"><span class="hs-identifier hs-var">get'</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b -&gt; b
</span><a href="#local-6989586621679689357"><span class="hs-identifier hs-var">set'</span></a></span><span> </span><span class="annot"><span class="annottext">((a -&gt; a) -&gt; b -&gt; b) -&gt; ReadE (a -&gt; a) -&gt; ReadE (b -&gt; b)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-operator hs-var">`fmap`</span></a></span><span> </span><span class="annot"><span class="annottext">ReadE (a -&gt; a)
</span><a href="#local-6989586621679689353"><span class="hs-identifier hs-var">set</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; LFlags
</span><a href="#local-6989586621679689352"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; LFlags) -&gt; (b -&gt; a) -&gt; b -&gt; LFlags
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; a
</span><a href="#local-6989586621679689358"><span class="hs-identifier hs-var">get'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-271"></span><span>
</span><span id="line-272"></span><span class="annot"><a href="Distribution.Simple.Command.html#liftOptDescr"><span class="hs-identifier hs-var">liftOptDescr</span></a></span><span> </span><span id="local-6989586621679689351"><span class="annot"><span class="annottext">b -&gt; a
</span><a href="#local-6989586621679689351"><span class="hs-identifier hs-var">get'</span></a></span></span><span> </span><span id="local-6989586621679689350"><span class="annot"><span class="annottext">a -&gt; b -&gt; b
</span><a href="#local-6989586621679689350"><span class="hs-identifier hs-var">set'</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Command.html#BoolOpt"><span class="hs-identifier hs-type">BoolOpt</span></a></span><span> </span><span id="local-6989586621679689349"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689349"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span id="local-6989586621679689348"><span class="annot"><span class="annottext">OptFlags
</span><a href="#local-6989586621679689348"><span class="hs-identifier hs-var">ffT</span></a></span></span><span> </span><span id="local-6989586621679689347"><span class="annot"><span class="annottext">OptFlags
</span><a href="#local-6989586621679689347"><span class="hs-identifier hs-var">ffF</span></a></span></span><span> </span><span id="local-6989586621679689346"><span class="annot"><span class="annottext">Bool -&gt; a -&gt; a
</span><a href="#local-6989586621679689346"><span class="hs-identifier hs-var">set</span></a></span></span><span> </span><span id="local-6989586621679689345"><span class="annot"><span class="annottext">a -&gt; Maybe Bool
</span><a href="#local-6989586621679689345"><span class="hs-identifier hs-var">get</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-273"></span><span>    </span><span class="annot"><span class="annottext">String
-&gt; OptFlags
-&gt; OptFlags
-&gt; (Bool -&gt; b -&gt; b)
-&gt; (b -&gt; Maybe Bool)
-&gt; OptDescr b
forall a.
String
-&gt; OptFlags
-&gt; OptFlags
-&gt; (Bool -&gt; a -&gt; a)
-&gt; (a -&gt; Maybe Bool)
-&gt; OptDescr a
</span><a href="Distribution.Simple.Command.html#BoolOpt"><span class="hs-identifier hs-var">BoolOpt</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689349"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">OptFlags
</span><a href="#local-6989586621679689348"><span class="hs-identifier hs-var">ffT</span></a></span><span> </span><span class="annot"><span class="annottext">OptFlags
</span><a href="#local-6989586621679689347"><span class="hs-identifier hs-var">ffF</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(b -&gt; a) -&gt; (a -&gt; b -&gt; b) -&gt; (a -&gt; a) -&gt; b -&gt; b
forall b a. (b -&gt; a) -&gt; (a -&gt; b -&gt; b) -&gt; (a -&gt; a) -&gt; b -&gt; b
</span><a href="Distribution.Simple.Command.html#liftSet"><span class="hs-identifier hs-var">liftSet</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; a
</span><a href="#local-6989586621679689351"><span class="hs-identifier hs-var">get'</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b -&gt; b
</span><a href="#local-6989586621679689350"><span class="hs-identifier hs-var">set'</span></a></span><span> </span><span class="annot"><span class="annottext">((a -&gt; a) -&gt; b -&gt; b) -&gt; (Bool -&gt; a -&gt; a) -&gt; Bool -&gt; b -&gt; b
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; a -&gt; a
</span><a href="#local-6989586621679689346"><span class="hs-identifier hs-var">set</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; Maybe Bool
</span><a href="#local-6989586621679689345"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; Maybe Bool) -&gt; (b -&gt; a) -&gt; b -&gt; Maybe Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; a
</span><a href="#local-6989586621679689351"><span class="hs-identifier hs-var">get'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-274"></span><span>
</span><span id="line-275"></span><span id="local-6989586621679689718"><span id="local-6989586621679689719"><span class="annot"><a href="Distribution.Simple.Command.html#liftSet"><span class="hs-identifier hs-type">liftSet</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689719"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689718"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689718"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689719"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689719"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689718"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689718"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689719"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689719"><span class="hs-identifier hs-type">b</span></a></span></span></span><span>
</span><span id="line-276"></span><span id="liftSet"><span class="annot"><span class="annottext">liftSet :: forall b a. (b -&gt; a) -&gt; (a -&gt; b -&gt; b) -&gt; (a -&gt; a) -&gt; b -&gt; b
</span><a href="Distribution.Simple.Command.html#liftSet"><span class="hs-identifier hs-var hs-var">liftSet</span></a></span></span><span> </span><span id="local-6989586621679689344"><span class="annot"><span class="annottext">b -&gt; a
</span><a href="#local-6989586621679689344"><span class="hs-identifier hs-var">get'</span></a></span></span><span> </span><span id="local-6989586621679689343"><span class="annot"><span class="annottext">a -&gt; b -&gt; b
</span><a href="#local-6989586621679689343"><span class="hs-identifier hs-var">set'</span></a></span></span><span> </span><span id="local-6989586621679689342"><span class="annot"><span class="annottext">a -&gt; a
</span><a href="#local-6989586621679689342"><span class="hs-identifier hs-var">set</span></a></span></span><span> </span><span id="local-6989586621679689341"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679689341"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; b -&gt; b
</span><a href="#local-6989586621679689343"><span class="hs-identifier hs-var">set'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; a
</span><a href="#local-6989586621679689342"><span class="hs-identifier hs-var">set</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; a) -&gt; a -&gt; a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; a
</span><a href="#local-6989586621679689344"><span class="hs-identifier hs-var">get'</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679689341"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679689341"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-277"></span><span>
</span><span id="line-278"></span><span class="hs-comment">-- | Show flags in the standard long option command line format</span><span>
</span><span id="line-279"></span><span id="local-6989586621679689715"><span class="annot"><a href="Distribution.Simple.Command.html#commandShowOptions"><span class="hs-identifier hs-type">commandShowOptions</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#CommandUI"><span class="hs-identifier hs-type">CommandUI</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689715"><span class="hs-identifier hs-type">flags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689715"><span class="hs-identifier hs-type">flags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-280"></span><span id="commandShowOptions"><span class="annot"><span class="annottext">commandShowOptions :: forall flags. CommandUI flags -&gt; flags -&gt; LFlags
</span><a href="Distribution.Simple.Command.html#commandShowOptions"><span class="hs-identifier hs-var hs-var">commandShowOptions</span></a></span></span><span> </span><span id="local-6989586621679689339"><span class="annot"><span class="annottext">CommandUI flags
</span><a href="#local-6989586621679689339"><span class="hs-identifier hs-var">command</span></a></span></span><span> </span><span id="local-6989586621679689338"><span class="annot"><span class="annottext">flags
</span><a href="#local-6989586621679689338"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[LFlags] -&gt; LFlags
forall (t :: * -&gt; *) a. Foldable t =&gt; t [a] -&gt; [a]
</span><a href="../../base/src/Data.Foldable.html#concat"><span class="hs-identifier hs-var">concat</span></a></span><span>
</span><span id="line-281"></span><span>  </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">flags -&gt; OptDescr flags -&gt; LFlags
forall a. a -&gt; OptDescr a -&gt; LFlags
</span><a href="#local-6989586621679689336"><span class="hs-identifier hs-var">showOptDescr</span></a></span><span> </span><span class="annot"><span class="annottext">flags
</span><a href="#local-6989586621679689338"><span class="hs-identifier hs-var">v</span></a></span><span>  </span><span class="annot"><span class="annottext">OptDescr flags
</span><a href="#local-6989586621679689335"><span class="hs-identifier hs-var">od</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679689334"><span class="annot"><span class="annottext">OptionField flags
</span><a href="#local-6989586621679689334"><span class="hs-identifier hs-var">o</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CommandUI flags -&gt; ShowOrParseArgs -&gt; [OptionField flags]
forall flags.
CommandUI flags -&gt; ShowOrParseArgs -&gt; [OptionField flags]
</span><a href="Distribution.Simple.Command.html#commandOptions"><span class="hs-identifier hs-var hs-var">commandOptions</span></a></span><span> </span><span class="annot"><span class="annottext">CommandUI flags
</span><a href="#local-6989586621679689339"><span class="hs-identifier hs-var">command</span></a></span><span> </span><span class="annot"><span class="annottext">ShowOrParseArgs
</span><a href="Distribution.Simple.Command.html#ParseArgs"><span class="hs-identifier hs-var">ParseArgs</span></a></span><span>
</span><span id="line-282"></span><span>                       </span><span class="hs-special">,</span><span> </span><span id="local-6989586621679689335"><span class="annot"><span class="annottext">OptDescr flags
</span><a href="#local-6989586621679689335"><span class="hs-identifier hs-var">od</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">OptionField flags -&gt; [OptDescr flags]
forall a. OptionField a -&gt; [OptDescr a]
</span><a href="Distribution.Simple.Command.html#optionDescr"><span class="hs-identifier hs-var hs-var">optionDescr</span></a></span><span> </span><span class="annot"><span class="annottext">OptionField flags
</span><a href="#local-6989586621679689334"><span class="hs-identifier hs-var">o</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-283"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-284"></span><span>    </span><span id="local-6989586621679689333"><span class="annot"><span class="annottext">maybePrefix :: LFlags -&gt; LFlags
</span><a href="#local-6989586621679689333"><span class="hs-identifier hs-var hs-var">maybePrefix</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-285"></span><span>    </span><span class="annot"><a href="#local-6989586621679689333"><span class="hs-identifier hs-var">maybePrefix</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679689332"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689332"><span class="hs-identifier hs-var">lOpt</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span class="annot"><span class="annottext">LFlags
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;--&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689332"><span class="hs-identifier hs-var">lOpt</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-286"></span><span>
</span><span id="line-287"></span><span>    </span><span id="local-6989586621679689711"><span class="annot"><a href="#local-6989586621679689336"><span class="hs-identifier hs-type">showOptDescr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679689711"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#OptDescr"><span class="hs-identifier hs-type">OptDescr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689711"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-288"></span><span>    </span><span id="local-6989586621679689336"><span class="annot"><span class="annottext">showOptDescr :: forall a. a -&gt; OptDescr a -&gt; LFlags
</span><a href="#local-6989586621679689336"><span class="hs-identifier hs-var hs-var">showOptDescr</span></a></span></span><span> </span><span id="local-6989586621679689329"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679689329"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Command.html#BoolOpt"><span class="hs-identifier hs-type">BoolOpt</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span id="local-6989586621679689328"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689328"><span class="hs-identifier hs-var">lfTs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span id="local-6989586621679689327"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689327"><span class="hs-identifier hs-var">lfFs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; a -&gt; a
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679689326"><span class="annot"><span class="annottext">a -&gt; Maybe Bool
</span><a href="#local-6989586621679689326"><span class="hs-identifier hs-var">enabled</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-289"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">a -&gt; Maybe Bool
</span><a href="#local-6989586621679689326"><span class="hs-identifier hs-var">enabled</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679689329"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-290"></span><span>          </span><span class="annot"><span class="annottext">Maybe Bool
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-291"></span><span>          </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">LFlags -&gt; LFlags
</span><a href="#local-6989586621679689333"><span class="hs-identifier hs-var">maybePrefix</span></a></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689328"><span class="hs-identifier hs-var">lfTs</span></a></span><span>
</span><span id="line-292"></span><span>          </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">LFlags -&gt; LFlags
</span><a href="#local-6989586621679689333"><span class="hs-identifier hs-var">maybePrefix</span></a></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689327"><span class="hs-identifier hs-var">lfFs</span></a></span><span>
</span><span id="line-293"></span><span>    </span><span class="annot"><a href="#local-6989586621679689336"><span class="hs-identifier hs-var">showOptDescr</span></a></span><span> </span><span id="local-6989586621679689325"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679689325"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679689324"><span class="annot"><span class="annottext">c :: OptDescr a
</span><a href="#local-6989586621679689324"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="Distribution.Simple.Command.html#ChoiceOpt"><span class="hs-identifier hs-type">ChoiceOpt</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span>
</span><span id="line-294"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;--&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689323"><span class="hs-identifier hs-var">val</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679689323"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689323"><span class="hs-identifier hs-var">val</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">OptDescr a -&gt; a -&gt; LFlags
forall a. OptDescr a -&gt; a -&gt; LFlags
</span><a href="Distribution.Simple.Command.html#getCurrentChoice"><span class="hs-identifier hs-var">getCurrentChoice</span></a></span><span> </span><span class="annot"><span class="annottext">OptDescr a
</span><a href="#local-6989586621679689324"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679689325"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-295"></span><span>    </span><span class="annot"><a href="#local-6989586621679689336"><span class="hs-identifier hs-var">showOptDescr</span></a></span><span> </span><span id="local-6989586621679689322"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679689322"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Command.html#ReqArg"><span class="hs-identifier hs-type">ReqArg</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679689321"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689321"><span class="hs-identifier hs-var">_ssff</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679689320"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689320"><span class="hs-identifier hs-var">lf</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span class="annot"><span class="annottext">LFlags
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ReadE (a -&gt; a)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679689319"><span class="annot"><span class="annottext">a -&gt; LFlags
</span><a href="#local-6989586621679689319"><span class="hs-identifier hs-var">showflag</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-296"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;--&quot;</span></span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689320"><span class="hs-identifier hs-var">lf</span></a></span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;=&quot;</span></span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689318"><span class="hs-identifier hs-var">flag</span></a></span><span>
</span><span id="line-297"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679689318"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689318"><span class="hs-identifier hs-var">flag</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">a -&gt; LFlags
</span><a href="#local-6989586621679689319"><span class="hs-identifier hs-var">showflag</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679689322"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-298"></span><span>    </span><span class="annot"><a href="#local-6989586621679689336"><span class="hs-identifier hs-var">showOptDescr</span></a></span><span> </span><span id="local-6989586621679689317"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679689317"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Command.html#OptArg"><span class="hs-identifier hs-type">OptArg</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679689316"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689316"><span class="hs-identifier hs-var">_ssff</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679689315"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689315"><span class="hs-identifier hs-var">lf</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span class="annot"><span class="annottext">LFlags
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ReadE (a -&gt; a)
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">a -&gt; a
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679689314"><span class="annot"><span class="annottext">a -&gt; [Maybe String]
</span><a href="#local-6989586621679689314"><span class="hs-identifier hs-var">showflag</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-299"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe String
</span><a href="#local-6989586621679689313"><span class="hs-identifier hs-var">flag</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-300"></span><span>            </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679689312"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689312"><span class="hs-identifier hs-var">s</span></a></span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;--&quot;</span></span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689315"><span class="hs-identifier hs-var">lf</span></a></span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;=&quot;</span></span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689312"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-301"></span><span>            </span><span class="annot"><span class="annottext">Maybe String
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;--&quot;</span></span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689315"><span class="hs-identifier hs-var">lf</span></a></span><span>
</span><span id="line-302"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679689313"><span class="annot"><span class="annottext">Maybe String
</span><a href="#local-6989586621679689313"><span class="hs-identifier hs-var">flag</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">a -&gt; [Maybe String]
</span><a href="#local-6989586621679689314"><span class="hs-identifier hs-var">showflag</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679689317"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-303"></span><span>    </span><span class="annot"><a href="#local-6989586621679689336"><span class="hs-identifier hs-var">showOptDescr</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">OptDescr a
</span><span class="hs-identifier">_</span></span><span>
</span><span id="line-304"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; LFlags
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Distribution.Simple.Command.showOptDescr: unreachable&quot;</span></span><span>
</span><span id="line-305"></span><span>
</span><span id="line-306"></span><span>
</span><span id="line-307"></span><span id="local-6989586621679689709"><span class="annot"><a href="Distribution.Simple.Command.html#commandListOptions"><span class="hs-identifier hs-type">commandListOptions</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#CommandUI"><span class="hs-identifier hs-type">CommandUI</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689709"><span class="hs-identifier hs-type">flags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-308"></span><span id="commandListOptions"><span class="annot"><span class="annottext">commandListOptions :: forall flags. CommandUI flags -&gt; LFlags
</span><a href="Distribution.Simple.Command.html#commandListOptions"><span class="hs-identifier hs-var hs-var">commandListOptions</span></a></span></span><span> </span><span id="local-6989586621679689309"><span class="annot"><span class="annottext">CommandUI flags
</span><a href="#local-6989586621679689309"><span class="hs-identifier hs-var">command</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-309"></span><span>  </span><span class="annot"><span class="annottext">(OptDescr (Either CommonFlag (flags -&gt; flags)) -&gt; LFlags)
-&gt; [OptDescr (Either CommonFlag (flags -&gt; flags))] -&gt; LFlags
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="annot"><span class="annottext">OptDescr (Either CommonFlag (flags -&gt; flags)) -&gt; LFlags
forall {a}. OptDescr a -&gt; LFlags
</span><a href="#local-6989586621679689308"><span class="hs-identifier hs-var">listOption</span></a></span><span> </span><span class="annot"><span class="annottext">([OptDescr (Either CommonFlag (flags -&gt; flags))] -&gt; LFlags)
-&gt; [OptDescr (Either CommonFlag (flags -&gt; flags))] -&gt; LFlags
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-310"></span><span>    </span><span class="annot"><span class="annottext">ShowOrParseArgs
-&gt; [OptDescr (flags -&gt; flags)]
-&gt; [OptDescr (Either CommonFlag (flags -&gt; flags))]
forall a.
ShowOrParseArgs -&gt; [OptDescr a] -&gt; [OptDescr (Either CommonFlag a)]
</span><a href="Distribution.Simple.Command.html#addCommonFlags"><span class="hs-identifier hs-var">addCommonFlags</span></a></span><span> </span><span class="annot"><span class="annottext">ShowOrParseArgs
</span><a href="Distribution.Simple.Command.html#ShowArgs"><span class="hs-identifier hs-var">ShowArgs</span></a></span><span> </span><span class="annot"><span class="annottext">([OptDescr (flags -&gt; flags)]
 -&gt; [OptDescr (Either CommonFlag (flags -&gt; flags))])
-&gt; [OptDescr (flags -&gt; flags)]
-&gt; [OptDescr (Either CommonFlag (flags -&gt; flags))]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-comment">-- This is a slight hack, we don't want</span><span>
</span><span id="line-311"></span><span>                              </span><span class="hs-comment">-- &quot;--list-options&quot; showing up in the</span><span>
</span><span id="line-312"></span><span>                              </span><span class="hs-comment">-- list options output, so use ShowArgs</span><span>
</span><span id="line-313"></span><span>      </span><span class="annot"><span class="annottext">ShowOrParseArgs -&gt; CommandUI flags -&gt; [OptDescr (flags -&gt; flags)]
forall flags.
ShowOrParseArgs -&gt; CommandUI flags -&gt; [OptDescr (flags -&gt; flags)]
</span><a href="Distribution.Simple.Command.html#commandGetOpts"><span class="hs-identifier hs-var">commandGetOpts</span></a></span><span> </span><span class="annot"><span class="annottext">ShowOrParseArgs
</span><a href="Distribution.Simple.Command.html#ShowArgs"><span class="hs-identifier hs-var">ShowArgs</span></a></span><span> </span><span class="annot"><span class="annottext">CommandUI flags
</span><a href="#local-6989586621679689309"><span class="hs-identifier hs-var">command</span></a></span><span>
</span><span id="line-314"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-315"></span><span>    </span><span id="local-6989586621679689308"><span class="annot"><span class="annottext">listOption :: OptDescr a -&gt; LFlags
</span><a href="#local-6989586621679689308"><span class="hs-identifier hs-var hs-var">listOption</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/System.Console.GetOpt.html#Option"><span class="hs-identifier hs-type">GetOpt.Option</span></a></span><span> </span><span id="local-6989586621679689306"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689306"><span class="hs-identifier hs-var">shortNames</span></a></span></span><span> </span><span id="local-6989586621679689305"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689305"><span class="hs-identifier hs-var">longNames</span></a></span></span><span> </span><span class="annot"><span class="annottext">ArgDescr a
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-316"></span><span>         </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;-&quot;</span></span><span>  </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679689304"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679689304"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679689304"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689306"><span class="hs-identifier hs-var">shortNames</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-317"></span><span>      </span><span class="annot"><span class="annottext">LFlags -&gt; LFlags -&gt; LFlags
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;--&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>  </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689303"><span class="hs-identifier hs-var">name</span></a></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679689303"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689303"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689305"><span class="hs-identifier hs-var">longNames</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-318"></span><span>
</span><span id="line-319"></span><span class="hs-comment">-- | The help text for this command with descriptions of all the options.</span><span>
</span><span id="line-320"></span><span id="local-6989586621679689302"><span class="annot"><a href="Distribution.Simple.Command.html#commandHelp"><span class="hs-identifier hs-type">commandHelp</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#CommandUI"><span class="hs-identifier hs-type">CommandUI</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689302"><span class="hs-identifier hs-type">flags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span></span><span>
</span><span id="line-321"></span><span id="commandHelp"><span class="annot"><span class="annottext">commandHelp :: forall flags. CommandUI flags -&gt; String -&gt; String
</span><a href="Distribution.Simple.Command.html#commandHelp"><span class="hs-identifier hs-var hs-var">commandHelp</span></a></span></span><span> </span><span id="local-6989586621679689297"><span class="annot"><span class="annottext">CommandUI flags
</span><a href="#local-6989586621679689297"><span class="hs-identifier hs-var">command</span></a></span></span><span> </span><span id="local-6989586621679689296"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689296"><span class="hs-identifier hs-var">pname</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-322"></span><span>    </span><span class="annot"><span class="annottext">CommandUI flags -&gt; String
forall flags. CommandUI flags -&gt; String
</span><a href="Distribution.Simple.Command.html#commandSynopsis"><span class="hs-identifier hs-var hs-var">commandSynopsis</span></a></span><span> </span><span class="annot"><span class="annottext">CommandUI flags
</span><a href="#local-6989586621679689297"><span class="hs-identifier hs-var">command</span></a></span><span>
</span><span id="line-323"></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;\n\n&quot;</span></span><span>
</span><span id="line-324"></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">CommandUI flags -&gt; String -&gt; String
forall flags. CommandUI flags -&gt; String -&gt; String
</span><a href="Distribution.Simple.Command.html#commandUsage"><span class="hs-identifier hs-var hs-var">commandUsage</span></a></span><span> </span><span class="annot"><span class="annottext">CommandUI flags
</span><a href="#local-6989586621679689297"><span class="hs-identifier hs-var">command</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689296"><span class="hs-identifier hs-var">pname</span></a></span><span>
</span><span id="line-325"></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">CommandUI flags -&gt; Maybe (String -&gt; String)
forall flags. CommandUI flags -&gt; Maybe (String -&gt; String)
</span><a href="Distribution.Simple.Command.html#commandDescription"><span class="hs-identifier hs-var hs-var">commandDescription</span></a></span><span> </span><span class="annot"><span class="annottext">CommandUI flags
</span><a href="#local-6989586621679689297"><span class="hs-identifier hs-var">command</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-326"></span><span>        </span><span class="annot"><span class="annottext">Maybe (String -&gt; String)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-327"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679689295"><span class="annot"><span class="annottext">String -&gt; String
</span><a href="#local-6989586621679689295"><span class="hs-identifier hs-var">desc</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\n'</span></span><span class="annot"><span class="annottext">Char -&gt; String -&gt; String
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="#local-6989586621679689295"><span class="hs-identifier hs-var">desc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689296"><span class="hs-identifier hs-var">pname</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-328"></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;\n&quot;</span></span><span>
</span><span id="line-329"></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689294"><span class="hs-identifier hs-var">cname</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-330"></span><span>        </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Global flags:&quot;</span></span><span>
</span><span id="line-331"></span><span>        </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Flags for &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689294"><span class="hs-identifier hs-var">cname</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;:&quot;</span></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-332"></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">String -&gt; [OptDescr (Either CommonFlag (flags -&gt; flags))] -&gt; String
forall a. String -&gt; [OptDescr a] -&gt; String
</span><a href="Distribution.GetOpt.html#usageInfo"><span class="hs-identifier hs-var">GetOpt.usageInfo</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-333"></span><span>    </span><span class="annot"><span class="annottext">([OptDescr (Either CommonFlag (flags -&gt; flags))] -&gt; String)
-&gt; ([OptDescr (flags -&gt; flags)]
    -&gt; [OptDescr (Either CommonFlag (flags -&gt; flags))])
-&gt; [OptDescr (flags -&gt; flags)]
-&gt; String
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ShowOrParseArgs
-&gt; [OptDescr (flags -&gt; flags)]
-&gt; [OptDescr (Either CommonFlag (flags -&gt; flags))]
forall a.
ShowOrParseArgs -&gt; [OptDescr a] -&gt; [OptDescr (Either CommonFlag a)]
</span><a href="Distribution.Simple.Command.html#addCommonFlags"><span class="hs-identifier hs-var">addCommonFlags</span></a></span><span> </span><span class="annot"><span class="annottext">ShowOrParseArgs
</span><a href="Distribution.Simple.Command.html#ShowArgs"><span class="hs-identifier hs-var">ShowArgs</span></a></span><span>
</span><span id="line-334"></span><span>    </span><span class="annot"><span class="annottext">([OptDescr (flags -&gt; flags)] -&gt; String)
-&gt; [OptDescr (flags -&gt; flags)] -&gt; String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ShowOrParseArgs -&gt; CommandUI flags -&gt; [OptDescr (flags -&gt; flags)]
forall flags.
ShowOrParseArgs -&gt; CommandUI flags -&gt; [OptDescr (flags -&gt; flags)]
</span><a href="Distribution.Simple.Command.html#commandGetOpts"><span class="hs-identifier hs-var">commandGetOpts</span></a></span><span> </span><span class="annot"><span class="annottext">ShowOrParseArgs
</span><a href="Distribution.Simple.Command.html#ShowArgs"><span class="hs-identifier hs-var">ShowArgs</span></a></span><span> </span><span class="annot"><span class="annottext">CommandUI flags
</span><a href="#local-6989586621679689297"><span class="hs-identifier hs-var">command</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-335"></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">CommandUI flags -&gt; Maybe (String -&gt; String)
forall flags. CommandUI flags -&gt; Maybe (String -&gt; String)
</span><a href="Distribution.Simple.Command.html#commandNotes"><span class="hs-identifier hs-var hs-var">commandNotes</span></a></span><span> </span><span class="annot"><span class="annottext">CommandUI flags
</span><a href="#local-6989586621679689297"><span class="hs-identifier hs-var">command</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-336"></span><span>        </span><span class="annot"><span class="annottext">Maybe (String -&gt; String)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-337"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679689292"><span class="annot"><span class="annottext">String -&gt; String
</span><a href="#local-6989586621679689292"><span class="hs-identifier hs-var">notes</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\n'</span></span><span class="annot"><span class="annottext">Char -&gt; String -&gt; String
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="#local-6989586621679689292"><span class="hs-identifier hs-var">notes</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689296"><span class="hs-identifier hs-var">pname</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-338"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679689294"><span class="annot"><span class="annottext">cname :: String
</span><a href="#local-6989586621679689294"><span class="hs-identifier hs-var hs-var">cname</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CommandUI flags -&gt; String
forall flags. CommandUI flags -&gt; String
</span><a href="Distribution.Simple.Command.html#commandName"><span class="hs-identifier hs-var hs-var">commandName</span></a></span><span> </span><span class="annot"><span class="annottext">CommandUI flags
</span><a href="#local-6989586621679689297"><span class="hs-identifier hs-var">command</span></a></span><span>
</span><span id="line-339"></span><span>
</span><span id="line-340"></span><span class="hs-comment">-- | Default &quot;usage&quot; documentation text for commands.</span><span>
</span><span id="line-341"></span><span class="annot"><a href="Distribution.Simple.Command.html#usageDefault"><span class="hs-identifier hs-type">usageDefault</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-342"></span><span id="usageDefault"><span class="annot"><span class="annottext">usageDefault :: String -&gt; String -&gt; String
</span><a href="Distribution.Simple.Command.html#usageDefault"><span class="hs-identifier hs-var hs-var">usageDefault</span></a></span></span><span> </span><span id="local-6989586621679689291"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689291"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621679689290"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689290"><span class="hs-identifier hs-var">pname</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-343"></span><span>     </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Usage: &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689290"><span class="hs-identifier hs-var">pname</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689291"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; [FLAGS]\n\n&quot;</span></span><span>
</span><span id="line-344"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Flags for &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689291"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;:&quot;</span></span><span>
</span><span id="line-345"></span><span>
</span><span id="line-346"></span><span class="hs-comment">-- | Create &quot;usage&quot; documentation from a list of parameter</span><span>
</span><span id="line-347"></span><span class="hs-comment">--   configurations.</span><span>
</span><span id="line-348"></span><span class="annot"><a href="Distribution.Simple.Command.html#usageAlternatives"><span class="hs-identifier hs-type">usageAlternatives</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-349"></span><span id="usageAlternatives"><span class="annot"><span class="annottext">usageAlternatives :: String -&gt; LFlags -&gt; String -&gt; String
</span><a href="Distribution.Simple.Command.html#usageAlternatives"><span class="hs-identifier hs-var hs-var">usageAlternatives</span></a></span></span><span> </span><span id="local-6989586621679689289"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689289"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621679689288"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689288"><span class="hs-identifier hs-var">strs</span></a></span></span><span> </span><span id="local-6989586621679689287"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689287"><span class="hs-identifier hs-var">pname</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LFlags -&gt; String
</span><a href="../../base/src/Data.OldList.html#unlines"><span class="hs-identifier hs-var">unlines</span></a></span><span>
</span><span id="line-350"></span><span>  </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689285"><span class="hs-identifier hs-var">start</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689287"><span class="hs-identifier hs-var">pname</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689289"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689284"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-351"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679689283"><span class="annot"><span class="annottext">starts :: LFlags
</span><a href="#local-6989586621679689283"><span class="hs-identifier hs-var hs-var">starts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Usage: &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; LFlags -&gt; LFlags
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; LFlags
forall a. a -&gt; [a]
</span><a href="../../base/src/GHC.List.html#repeat"><span class="hs-identifier hs-var">repeat</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;   or: &quot;</span></span><span>
</span><span id="line-352"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679689285"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689285"><span class="hs-identifier hs-var">start</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679689284"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689284"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LFlags -&gt; LFlags -&gt; [(String, String)]
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="../../base/src/GHC.List.html#zip"><span class="hs-identifier hs-var">zip</span></a></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689283"><span class="hs-identifier hs-var">starts</span></a></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689288"><span class="hs-identifier hs-var">strs</span></a></span><span>
</span><span id="line-353"></span><span>  </span><span class="hs-special">]</span><span>
</span><span id="line-354"></span><span>
</span><span id="line-355"></span><span class="hs-comment">-- | Make a Command from standard 'GetOpt' options.</span><span>
</span><span id="line-356"></span><span id="local-6989586621679689698"><span class="annot"><a href="Distribution.Simple.Command.html#mkCommandUI"><span class="hs-identifier hs-type">mkCommandUI</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>          </span><span class="hs-comment">-- ^ name</span><span>
</span><span id="line-357"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>          </span><span class="hs-comment">-- ^ synopsis</span><span>
</span><span id="line-358"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>        </span><span class="hs-comment">-- ^ usage alternatives</span><span>
</span><span id="line-359"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689698"><span class="hs-identifier hs-type">flags</span></a></span><span>           </span><span class="hs-comment">-- ^ initial\/empty flags</span><span>
</span><span id="line-360"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Command.html#ShowOrParseArgs"><span class="hs-identifier hs-type">ShowOrParseArgs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Simple.Command.html#OptionField"><span class="hs-identifier hs-type">OptionField</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689698"><span class="hs-identifier hs-type">flags</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ options</span><span>
</span><span id="line-361"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#CommandUI"><span class="hs-identifier hs-type">CommandUI</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689698"><span class="hs-identifier hs-type">flags</span></a></span></span><span>
</span><span id="line-362"></span><span id="mkCommandUI"><span class="annot"><span class="annottext">mkCommandUI :: forall flags.
String
-&gt; String
-&gt; LFlags
-&gt; flags
-&gt; (ShowOrParseArgs -&gt; [OptionField flags])
-&gt; CommandUI flags
</span><a href="Distribution.Simple.Command.html#mkCommandUI"><span class="hs-identifier hs-var hs-var">mkCommandUI</span></a></span></span><span> </span><span id="local-6989586621679689281"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689281"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621679689280"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689280"><span class="hs-identifier hs-var">synopsis</span></a></span></span><span> </span><span id="local-6989586621679689279"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689279"><span class="hs-identifier hs-var">usages</span></a></span></span><span> </span><span id="local-6989586621679689278"><span class="annot"><span class="annottext">flags
</span><a href="#local-6989586621679689278"><span class="hs-identifier hs-var">flags</span></a></span></span><span> </span><span id="local-6989586621679689277"><span class="annot"><span class="annottext">ShowOrParseArgs -&gt; [OptionField flags]
</span><a href="#local-6989586621679689277"><span class="hs-identifier hs-var">options</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CommandUI :: forall flags.
String
-&gt; String
-&gt; (String -&gt; String)
-&gt; Maybe (String -&gt; String)
-&gt; Maybe (String -&gt; String)
-&gt; flags
-&gt; (ShowOrParseArgs -&gt; [OptionField flags])
-&gt; CommandUI flags
</span><a href="Distribution.Simple.Command.html#CommandUI"><span class="hs-identifier hs-type">CommandUI</span></a></span><span>
</span><span id="line-363"></span><span>  </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">commandName :: String
</span><a href="Distribution.Simple.Command.html#commandName"><span class="hs-identifier hs-var">commandName</span></a></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689281"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-364"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">commandSynopsis :: String
</span><a href="Distribution.Simple.Command.html#commandSynopsis"><span class="hs-identifier hs-var">commandSynopsis</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689280"><span class="hs-identifier hs-var">synopsis</span></a></span><span>
</span><span id="line-365"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">commandDescription :: Maybe (String -&gt; String)
</span><a href="Distribution.Simple.Command.html#commandDescription"><span class="hs-identifier hs-var">commandDescription</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (String -&gt; String)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-366"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">commandNotes :: Maybe (String -&gt; String)
</span><a href="Distribution.Simple.Command.html#commandNotes"><span class="hs-identifier hs-var">commandNotes</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (String -&gt; String)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-367"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">commandUsage :: String -&gt; String
</span><a href="Distribution.Simple.Command.html#commandUsage"><span class="hs-identifier hs-var">commandUsage</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; LFlags -&gt; String -&gt; String
</span><a href="Distribution.Simple.Command.html#usageAlternatives"><span class="hs-identifier hs-var">usageAlternatives</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689281"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689279"><span class="hs-identifier hs-var">usages</span></a></span><span>
</span><span id="line-368"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">commandDefaultFlags :: flags
</span><a href="Distribution.Simple.Command.html#commandDefaultFlags"><span class="hs-identifier hs-var">commandDefaultFlags</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">flags
</span><a href="#local-6989586621679689278"><span class="hs-identifier hs-var">flags</span></a></span><span>
</span><span id="line-369"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">commandOptions :: ShowOrParseArgs -&gt; [OptionField flags]
</span><a href="Distribution.Simple.Command.html#commandOptions"><span class="hs-identifier hs-var">commandOptions</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ShowOrParseArgs -&gt; [OptionField flags]
</span><a href="#local-6989586621679689277"><span class="hs-identifier hs-var">options</span></a></span><span>
</span><span id="line-370"></span><span>  </span><span class="hs-special">}</span><span>
</span><span id="line-371"></span><span>
</span><span id="line-372"></span><span class="hs-comment">-- | Common flags that apply to every command</span><span>
</span><span id="line-373"></span><span class="hs-keyword">data</span><span> </span><span id="CommonFlag"><span class="annot"><a href="Distribution.Simple.Command.html#CommonFlag"><span class="hs-identifier hs-var">CommonFlag</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="HelpFlag"><span class="annot"><a href="Distribution.Simple.Command.html#HelpFlag"><span class="hs-identifier hs-var">HelpFlag</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="ListOptionsFlag"><span class="annot"><a href="Distribution.Simple.Command.html#ListOptionsFlag"><span class="hs-identifier hs-var">ListOptionsFlag</span></a></span></span><span>
</span><span id="line-374"></span><span>
</span><span id="line-375"></span><span class="annot"><a href="Distribution.Simple.Command.html#commonFlags"><span class="hs-identifier hs-type">commonFlags</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#ShowOrParseArgs"><span class="hs-identifier hs-type">ShowOrParseArgs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/System.Console.GetOpt.html#OptDescr"><span class="hs-identifier hs-type">GetOpt.OptDescr</span></a></span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#CommonFlag"><span class="hs-identifier hs-type">CommonFlag</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-376"></span><span id="commonFlags"><span class="annot"><span class="annottext">commonFlags :: ShowOrParseArgs -&gt; [OptDescr CommonFlag]
</span><a href="Distribution.Simple.Command.html#commonFlags"><span class="hs-identifier hs-var hs-var">commonFlags</span></a></span></span><span> </span><span id="local-6989586621679689273"><span class="annot"><span class="annottext">ShowOrParseArgs
</span><a href="#local-6989586621679689273"><span class="hs-identifier hs-var">showOrParseArgs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ShowOrParseArgs
</span><a href="#local-6989586621679689273"><span class="hs-identifier hs-var">showOrParseArgs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-377"></span><span>  </span><span class="annot"><span class="annottext">ShowOrParseArgs
</span><a href="Distribution.Simple.Command.html#ShowArgs"><span class="hs-identifier hs-var">ShowArgs</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">OptDescr CommonFlag
</span><a href="#local-6989586621679689272"><span class="hs-identifier hs-var">help</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-378"></span><span>  </span><span class="annot"><span class="annottext">ShowOrParseArgs
</span><a href="Distribution.Simple.Command.html#ParseArgs"><span class="hs-identifier hs-var">ParseArgs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">OptDescr CommonFlag
</span><a href="#local-6989586621679689272"><span class="hs-identifier hs-var">help</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">OptDescr CommonFlag
</span><a href="#local-6989586621679689271"><span class="hs-identifier hs-var">list</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-379"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-380"></span><span>    </span><span id="local-6989586621679689272"><span class="annot"><span class="annottext">help :: OptDescr CommonFlag
</span><a href="#local-6989586621679689272"><span class="hs-identifier hs-var hs-var">help</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
-&gt; LFlags -&gt; ArgDescr CommonFlag -&gt; String -&gt; OptDescr CommonFlag
forall a. String -&gt; LFlags -&gt; ArgDescr a -&gt; String -&gt; OptDescr a
</span><a href="../../base/src/System.Console.GetOpt.html#Option"><span class="hs-identifier hs-var">GetOpt.Option</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689270"><span class="hs-identifier hs-var">helpShortFlags</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;help&quot;</span></span><span class="hs-special">]</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CommonFlag -&gt; ArgDescr CommonFlag
forall a. a -&gt; ArgDescr a
</span><a href="../../base/src/System.Console.GetOpt.html#NoArg"><span class="hs-identifier hs-var">GetOpt.NoArg</span></a></span><span> </span><span class="annot"><span class="annottext">CommonFlag
</span><a href="Distribution.Simple.Command.html#HelpFlag"><span class="hs-identifier hs-var">HelpFlag</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-381"></span><span>             </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Show this help text&quot;</span></span><span>
</span><span id="line-382"></span><span>    </span><span id="local-6989586621679689270"><span class="annot"><span class="annottext">helpShortFlags :: String
</span><a href="#local-6989586621679689270"><span class="hs-identifier hs-var hs-var">helpShortFlags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ShowOrParseArgs
</span><a href="#local-6989586621679689273"><span class="hs-identifier hs-var">showOrParseArgs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-383"></span><span>      </span><span class="annot"><span class="annottext">ShowOrParseArgs
</span><a href="Distribution.Simple.Command.html#ShowArgs"><span class="hs-identifier hs-var">ShowArgs</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'h'</span></span><span class="hs-special">]</span><span>
</span><span id="line-384"></span><span>      </span><span class="annot"><span class="annottext">ShowOrParseArgs
</span><a href="Distribution.Simple.Command.html#ParseArgs"><span class="hs-identifier hs-var">ParseArgs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'h'</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'?'</span></span><span class="hs-special">]</span><span>
</span><span id="line-385"></span><span>    </span><span id="local-6989586621679689271"><span class="annot"><span class="annottext">list :: OptDescr CommonFlag
</span><a href="#local-6989586621679689271"><span class="hs-identifier hs-var hs-var">list</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
-&gt; LFlags -&gt; ArgDescr CommonFlag -&gt; String -&gt; OptDescr CommonFlag
forall a. String -&gt; LFlags -&gt; ArgDescr a -&gt; String -&gt; OptDescr a
</span><a href="../../base/src/System.Console.GetOpt.html#Option"><span class="hs-identifier hs-var">GetOpt.Option</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;list-options&quot;</span></span><span class="hs-special">]</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CommonFlag -&gt; ArgDescr CommonFlag
forall a. a -&gt; ArgDescr a
</span><a href="../../base/src/System.Console.GetOpt.html#NoArg"><span class="hs-identifier hs-var">GetOpt.NoArg</span></a></span><span> </span><span class="annot"><span class="annottext">CommonFlag
</span><a href="Distribution.Simple.Command.html#ListOptionsFlag"><span class="hs-identifier hs-var">ListOptionsFlag</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-386"></span><span>             </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Print a list of command line flags&quot;</span></span><span>
</span><span id="line-387"></span><span>
</span><span id="line-388"></span><span id="local-6989586621679689705"><span class="annot"><a href="Distribution.Simple.Command.html#addCommonFlags"><span class="hs-identifier hs-type">addCommonFlags</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#ShowOrParseArgs"><span class="hs-identifier hs-type">ShowOrParseArgs</span></a></span><span>
</span><span id="line-389"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/System.Console.GetOpt.html#OptDescr"><span class="hs-identifier hs-type">GetOpt.OptDescr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689705"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-390"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/System.Console.GetOpt.html#OptDescr"><span class="hs-identifier hs-type">GetOpt.OptDescr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#CommonFlag"><span class="hs-identifier hs-type">CommonFlag</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689705"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span></span><span>
</span><span id="line-391"></span><span id="addCommonFlags"><span class="annot"><span class="annottext">addCommonFlags :: forall a.
ShowOrParseArgs -&gt; [OptDescr a] -&gt; [OptDescr (Either CommonFlag a)]
</span><a href="Distribution.Simple.Command.html#addCommonFlags"><span class="hs-identifier hs-var hs-var">addCommonFlags</span></a></span></span><span> </span><span id="local-6989586621679689269"><span class="annot"><span class="annottext">ShowOrParseArgs
</span><a href="#local-6989586621679689269"><span class="hs-identifier hs-var">showOrParseArgs</span></a></span></span><span> </span><span id="local-6989586621679689268"><span class="annot"><span class="annottext">[OptDescr a]
</span><a href="#local-6989586621679689268"><span class="hs-identifier hs-var">options</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-392"></span><span>     </span><span class="annot"><span class="annottext">(OptDescr CommonFlag -&gt; OptDescr (Either CommonFlag a))
-&gt; [OptDescr CommonFlag] -&gt; [OptDescr (Either CommonFlag a)]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(CommonFlag -&gt; Either CommonFlag a)
-&gt; OptDescr CommonFlag -&gt; OptDescr (Either CommonFlag a)
forall {b} {a}. (b -&gt; a) -&gt; OptDescr b -&gt; OptDescr a
</span><a href="#local-6989586621679689267"><span class="hs-identifier hs-var">fmapOptDesc</span></a></span><span> </span><span class="annot"><span class="annottext">CommonFlag -&gt; Either CommonFlag a
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span class="hs-special">)</span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ShowOrParseArgs -&gt; [OptDescr CommonFlag]
</span><a href="Distribution.Simple.Command.html#commonFlags"><span class="hs-identifier hs-var">commonFlags</span></a></span><span> </span><span class="annot"><span class="annottext">ShowOrParseArgs
</span><a href="#local-6989586621679689269"><span class="hs-identifier hs-var">showOrParseArgs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-393"></span><span>  </span><span class="annot"><span class="annottext">[OptDescr (Either CommonFlag a)]
-&gt; [OptDescr (Either CommonFlag a)]
-&gt; [OptDescr (Either CommonFlag a)]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">(OptDescr a -&gt; OptDescr (Either CommonFlag a))
-&gt; [OptDescr a] -&gt; [OptDescr (Either CommonFlag a)]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; Either CommonFlag a)
-&gt; OptDescr a -&gt; OptDescr (Either CommonFlag a)
forall {b} {a}. (b -&gt; a) -&gt; OptDescr b -&gt; OptDescr a
</span><a href="#local-6989586621679689267"><span class="hs-identifier hs-var">fmapOptDesc</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; Either CommonFlag a
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[OptDescr a]
</span><a href="#local-6989586621679689268"><span class="hs-identifier hs-var">options</span></a></span><span>
</span><span id="line-394"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679689267"><span class="annot"><span class="annottext">fmapOptDesc :: (b -&gt; a) -&gt; OptDescr b -&gt; OptDescr a
</span><a href="#local-6989586621679689267"><span class="hs-identifier hs-var hs-var">fmapOptDesc</span></a></span></span><span> </span><span id="local-6989586621679689266"><span class="annot"><span class="annottext">b -&gt; a
</span><a href="#local-6989586621679689266"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/System.Console.GetOpt.html#Option"><span class="hs-identifier hs-type">GetOpt.Option</span></a></span><span> </span><span id="local-6989586621679689265"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689265"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679689264"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689264"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621679689263"><span class="annot"><span class="annottext">ArgDescr b
</span><a href="#local-6989586621679689263"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span id="local-6989586621679689262"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689262"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-395"></span><span>                       </span><span class="annot"><span class="annottext">String -&gt; LFlags -&gt; ArgDescr a -&gt; String -&gt; OptDescr a
forall a. String -&gt; LFlags -&gt; ArgDescr a -&gt; String -&gt; OptDescr a
</span><a href="../../base/src/System.Console.GetOpt.html#Option"><span class="hs-identifier hs-var">GetOpt.Option</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689265"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689264"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(b -&gt; a) -&gt; ArgDescr b -&gt; ArgDescr a
forall {b} {a}. (b -&gt; a) -&gt; ArgDescr b -&gt; ArgDescr a
</span><a href="#local-6989586621679689261"><span class="hs-identifier hs-var">fmapArgDesc</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; a
</span><a href="#local-6989586621679689266"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">ArgDescr b
</span><a href="#local-6989586621679689263"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689262"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-396"></span><span>        </span><span id="local-6989586621679689261"><span class="annot"><span class="annottext">fmapArgDesc :: (b -&gt; a) -&gt; ArgDescr b -&gt; ArgDescr a
</span><a href="#local-6989586621679689261"><span class="hs-identifier hs-var hs-var">fmapArgDesc</span></a></span></span><span> </span><span id="local-6989586621679689260"><span class="annot"><span class="annottext">b -&gt; a
</span><a href="#local-6989586621679689260"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/System.Console.GetOpt.html#NoArg"><span class="hs-identifier hs-type">GetOpt.NoArg</span></a></span><span> </span><span id="local-6989586621679689259"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679689259"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; ArgDescr a
forall a. a -&gt; ArgDescr a
</span><a href="../../base/src/System.Console.GetOpt.html#NoArg"><span class="hs-identifier hs-var">GetOpt.NoArg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; a
</span><a href="#local-6989586621679689260"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679689259"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-397"></span><span>        </span><span class="annot"><a href="#local-6989586621679689261"><span class="hs-identifier hs-var">fmapArgDesc</span></a></span><span> </span><span id="local-6989586621679689258"><span class="annot"><span class="annottext">b -&gt; a
</span><a href="#local-6989586621679689258"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/System.Console.GetOpt.html#ReqArg"><span class="hs-identifier hs-type">GetOpt.ReqArg</span></a></span><span> </span><span id="local-6989586621679689257"><span class="annot"><span class="annottext">String -&gt; b
</span><a href="#local-6989586621679689257"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679689256"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689256"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(String -&gt; a) -&gt; String -&gt; ArgDescr a
forall a. (String -&gt; a) -&gt; String -&gt; ArgDescr a
</span><a href="../../base/src/System.Console.GetOpt.html#ReqArg"><span class="hs-identifier hs-var">GetOpt.ReqArg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; a
</span><a href="#local-6989586621679689258"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(b -&gt; a) -&gt; (String -&gt; b) -&gt; String -&gt; a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; b
</span><a href="#local-6989586621679689257"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689256"><span class="hs-identifier hs-var">d</span></a></span><span>
</span><span id="line-398"></span><span>        </span><span class="annot"><a href="#local-6989586621679689261"><span class="hs-identifier hs-var">fmapArgDesc</span></a></span><span> </span><span id="local-6989586621679689255"><span class="annot"><span class="annottext">b -&gt; a
</span><a href="#local-6989586621679689255"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/System.Console.GetOpt.html#OptArg"><span class="hs-identifier hs-type">GetOpt.OptArg</span></a></span><span> </span><span id="local-6989586621679689254"><span class="annot"><span class="annottext">Maybe String -&gt; b
</span><a href="#local-6989586621679689254"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679689253"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689253"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Maybe String -&gt; a) -&gt; String -&gt; ArgDescr a
forall a. (Maybe String -&gt; a) -&gt; String -&gt; ArgDescr a
</span><a href="../../base/src/System.Console.GetOpt.html#OptArg"><span class="hs-identifier hs-var">GetOpt.OptArg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; a
</span><a href="#local-6989586621679689255"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(b -&gt; a) -&gt; (Maybe String -&gt; b) -&gt; Maybe String -&gt; a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe String -&gt; b
</span><a href="#local-6989586621679689254"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689253"><span class="hs-identifier hs-var">d</span></a></span><span>
</span><span id="line-399"></span><span>
</span><span id="line-400"></span><span class="hs-comment">-- | Parse a bunch of command line arguments</span><span>
</span><span id="line-401"></span><span class="hs-comment">--</span><span>
</span><span id="line-402"></span><span id="local-6989586621679689689"><span class="annot"><a href="Distribution.Simple.Command.html#commandParseArgs"><span class="hs-identifier hs-type">commandParseArgs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#CommandUI"><span class="hs-identifier hs-type">CommandUI</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689689"><span class="hs-identifier hs-type">flags</span></a></span><span>
</span><span id="line-403"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>      </span><span class="hs-comment">-- ^ Is the command a global or subcommand?</span><span>
</span><span id="line-404"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-405"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#CommandParse"><span class="hs-identifier hs-type">CommandParse</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689689"><span class="hs-identifier hs-type">flags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689689"><span class="hs-identifier hs-type">flags</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span></span><span>
</span><span id="line-406"></span><span id="commandParseArgs"><span class="annot"><span class="annottext">commandParseArgs :: forall flags.
CommandUI flags
-&gt; Bool -&gt; LFlags -&gt; CommandParse (flags -&gt; flags, LFlags)
</span><a href="Distribution.Simple.Command.html#commandParseArgs"><span class="hs-identifier hs-var hs-var">commandParseArgs</span></a></span></span><span> </span><span id="local-6989586621679689249"><span class="annot"><span class="annottext">CommandUI flags
</span><a href="#local-6989586621679689249"><span class="hs-identifier hs-var">command</span></a></span></span><span> </span><span id="local-6989586621679689248"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679689248"><span class="hs-identifier hs-var">global</span></a></span></span><span> </span><span id="local-6989586621679689247"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689247"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-407"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679689246"><span class="annot"><span class="annottext">options :: [OptDescr (Either CommonFlag (flags -&gt; flags))]
</span><a href="#local-6989586621679689246"><span class="hs-identifier hs-var hs-var">options</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ShowOrParseArgs
-&gt; [OptDescr (flags -&gt; flags)]
-&gt; [OptDescr (Either CommonFlag (flags -&gt; flags))]
forall a.
ShowOrParseArgs -&gt; [OptDescr a] -&gt; [OptDescr (Either CommonFlag a)]
</span><a href="Distribution.Simple.Command.html#addCommonFlags"><span class="hs-identifier hs-var">addCommonFlags</span></a></span><span> </span><span class="annot"><span class="annottext">ShowOrParseArgs
</span><a href="Distribution.Simple.Command.html#ParseArgs"><span class="hs-identifier hs-var">ParseArgs</span></a></span><span>
</span><span id="line-408"></span><span>              </span><span class="annot"><span class="annottext">([OptDescr (flags -&gt; flags)]
 -&gt; [OptDescr (Either CommonFlag (flags -&gt; flags))])
-&gt; [OptDescr (flags -&gt; flags)]
-&gt; [OptDescr (Either CommonFlag (flags -&gt; flags))]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ShowOrParseArgs -&gt; CommandUI flags -&gt; [OptDescr (flags -&gt; flags)]
forall flags.
ShowOrParseArgs -&gt; CommandUI flags -&gt; [OptDescr (flags -&gt; flags)]
</span><a href="Distribution.Simple.Command.html#commandGetOpts"><span class="hs-identifier hs-var">commandGetOpts</span></a></span><span> </span><span class="annot"><span class="annottext">ShowOrParseArgs
</span><a href="Distribution.Simple.Command.html#ParseArgs"><span class="hs-identifier hs-var">ParseArgs</span></a></span><span> </span><span class="annot"><span class="annottext">CommandUI flags
</span><a href="#local-6989586621679689249"><span class="hs-identifier hs-var">command</span></a></span><span>
</span><span id="line-409"></span><span>      </span><span id="local-6989586621679689245"><span class="annot"><span class="annottext">order :: ArgOrder a
</span><a href="#local-6989586621679689245"><span class="hs-identifier hs-var hs-var">order</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679689248"><span class="hs-identifier hs-var">global</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ArgOrder a
forall a. ArgOrder a
</span><a href="../../base/src/System.Console.GetOpt.html#RequireOrder"><span class="hs-identifier hs-var">GetOpt.RequireOrder</span></a></span><span>
</span><span id="line-410"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ArgOrder a
forall a. ArgOrder a
</span><a href="../../base/src/System.Console.GetOpt.html#Permute"><span class="hs-identifier hs-var">GetOpt.Permute</span></a></span><span>
</span><span id="line-411"></span><span>  </span><span class="hs-keyword">in</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ArgOrder (Either CommonFlag (flags -&gt; flags))
-&gt; [OptDescr (Either CommonFlag (flags -&gt; flags))]
-&gt; LFlags
-&gt; ([Either CommonFlag (flags -&gt; flags)], LFlags, LFlags, LFlags)
forall a.
ArgOrder a
-&gt; [OptDescr a] -&gt; LFlags -&gt; ([a], LFlags, LFlags, LFlags)
</span><a href="Distribution.GetOpt.html#getOpt%27"><span class="hs-identifier hs-var">GetOpt.getOpt'</span></a></span><span> </span><span class="annot"><span class="annottext">ArgOrder (Either CommonFlag (flags -&gt; flags))
forall a. ArgOrder a
</span><a href="#local-6989586621679689245"><span class="hs-identifier hs-var">order</span></a></span><span> </span><span class="annot"><span class="annottext">[OptDescr (Either CommonFlag (flags -&gt; flags))]
</span><a href="#local-6989586621679689246"><span class="hs-identifier hs-var">options</span></a></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689247"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-412"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679689241"><span class="annot"><span class="annottext">[Either CommonFlag (flags -&gt; flags)]
</span><a href="#local-6989586621679689241"><span class="hs-identifier hs-var">flags</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LFlags
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LFlags
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span>  </span><span class="annot"><span class="annottext">LFlags
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>
</span><span id="line-413"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">(Either CommonFlag (flags -&gt; flags) -&gt; Bool)
-&gt; [Either CommonFlag (flags -&gt; flags)] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#any"><span class="hs-identifier hs-var">any</span></a></span><span> </span><span class="annot"><span class="annottext">Either CommonFlag (flags -&gt; flags) -&gt; Bool
forall {b}. Either CommonFlag b -&gt; Bool
</span><a href="#local-6989586621679689239"><span class="hs-identifier hs-var">listFlag</span></a></span><span> </span><span class="annot"><span class="annottext">[Either CommonFlag (flags -&gt; flags)]
</span><a href="#local-6989586621679689241"><span class="hs-identifier hs-var">flags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">LFlags -&gt; CommandParse (flags -&gt; flags, LFlags)
forall flags. LFlags -&gt; CommandParse flags
</span><a href="Distribution.Simple.Command.html#CommandList"><span class="hs-identifier hs-var">CommandList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CommandUI flags -&gt; LFlags
forall flags. CommandUI flags -&gt; LFlags
</span><a href="Distribution.Simple.Command.html#commandListOptions"><span class="hs-identifier hs-var">commandListOptions</span></a></span><span> </span><span class="annot"><span class="annottext">CommandUI flags
</span><a href="#local-6989586621679689249"><span class="hs-identifier hs-var">command</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-414"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">(Either CommonFlag (flags -&gt; flags) -&gt; Bool)
-&gt; [Either CommonFlag (flags -&gt; flags)] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#any"><span class="hs-identifier hs-var">any</span></a></span><span> </span><span class="annot"><span class="annottext">Either CommonFlag (flags -&gt; flags) -&gt; Bool
forall {b}. Either CommonFlag b -&gt; Bool
</span><a href="#local-6989586621679689237"><span class="hs-identifier hs-var">helpFlag</span></a></span><span> </span><span class="annot"><span class="annottext">[Either CommonFlag (flags -&gt; flags)]
</span><a href="#local-6989586621679689241"><span class="hs-identifier hs-var">flags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; CommandParse (flags -&gt; flags, LFlags)
forall flags. (String -&gt; String) -&gt; CommandParse flags
</span><a href="Distribution.Simple.Command.html#CommandHelp"><span class="hs-identifier hs-var">CommandHelp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CommandUI flags -&gt; String -&gt; String
forall flags. CommandUI flags -&gt; String -&gt; String
</span><a href="Distribution.Simple.Command.html#commandHelp"><span class="hs-identifier hs-var">commandHelp</span></a></span><span> </span><span class="annot"><span class="annottext">CommandUI flags
</span><a href="#local-6989586621679689249"><span class="hs-identifier hs-var">command</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-415"></span><span>      </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679689239"><span class="annot"><span class="annottext">listFlag :: Either CommonFlag b -&gt; Bool
</span><a href="#local-6989586621679689239"><span class="hs-identifier hs-var hs-var">listFlag</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span class="annot"><span class="annottext">CommonFlag
</span><a href="Distribution.Simple.Command.html#ListOptionsFlag"><span class="hs-identifier hs-var">ListOptionsFlag</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-special">;</span><span> </span><span class="annot"><a href="#local-6989586621679689239"><span class="hs-identifier hs-var">listFlag</span></a></span><span> </span><span class="annot"><span class="annottext">Either CommonFlag b
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-416"></span><span>            </span><span id="local-6989586621679689237"><span class="annot"><span class="annottext">helpFlag :: Either CommonFlag b -&gt; Bool
</span><a href="#local-6989586621679689237"><span class="hs-identifier hs-var hs-var">helpFlag</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span class="annot"><span class="annottext">CommonFlag
</span><a href="Distribution.Simple.Command.html#HelpFlag"><span class="hs-identifier hs-var">HelpFlag</span></a></span><span class="hs-special">)</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-special">;</span><span> </span><span class="annot"><a href="#local-6989586621679689237"><span class="hs-identifier hs-var">helpFlag</span></a></span><span> </span><span class="annot"><span class="annottext">Either CommonFlag b
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-417"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679689235"><span class="annot"><span class="annottext">[Either CommonFlag (flags -&gt; flags)]
</span><a href="#local-6989586621679689235"><span class="hs-identifier hs-var">flags</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679689234"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689234"><span class="hs-identifier hs-var">opts</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679689233"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689233"><span class="hs-identifier hs-var">opts'</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-418"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679689248"><span class="hs-identifier hs-var">global</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">LFlags -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689233"><span class="hs-identifier hs-var">opts'</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(flags -&gt; flags, LFlags) -&gt; CommandParse (flags -&gt; flags, LFlags)
forall flags. flags -&gt; CommandParse flags
</span><a href="Distribution.Simple.Command.html#CommandReadyToGo"><span class="hs-identifier hs-var">CommandReadyToGo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Either CommonFlag (flags -&gt; flags)] -&gt; flags -&gt; flags
forall {a} {c}. [Either a (c -&gt; c)] -&gt; c -&gt; c
</span><a href="#local-6989586621679689229"><span class="hs-identifier hs-var">accum</span></a></span><span> </span><span class="annot"><span class="annottext">[Either CommonFlag (flags -&gt; flags)]
</span><a href="#local-6989586621679689235"><span class="hs-identifier hs-var">flags</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LFlags -&gt; LFlags -&gt; LFlags
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="#local-6989586621679689228"><span class="hs-identifier hs-var">mix</span></a></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689234"><span class="hs-identifier hs-var">opts</span></a></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689233"><span class="hs-identifier hs-var">opts'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-419"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">LFlags -&gt; CommandParse (flags -&gt; flags, LFlags)
forall flags. LFlags -&gt; CommandParse flags
</span><a href="Distribution.Simple.Command.html#CommandErrors"><span class="hs-identifier hs-var">CommandErrors</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LFlags -&gt; LFlags
</span><a href="#local-6989586621679689226"><span class="hs-identifier hs-var">unrecognised</span></a></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689233"><span class="hs-identifier hs-var">opts'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-420"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Either CommonFlag (flags -&gt; flags)]
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LFlags
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LFlags
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679689225"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689225"><span class="hs-identifier hs-var">errs</span></a></span></span><span class="hs-special">)</span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">LFlags -&gt; CommandParse (flags -&gt; flags, LFlags)
forall flags. LFlags -&gt; CommandParse flags
</span><a href="Distribution.Simple.Command.html#CommandErrors"><span class="hs-identifier hs-var">CommandErrors</span></a></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689225"><span class="hs-identifier hs-var">errs</span></a></span><span>
</span><span id="line-421"></span><span>
</span><span id="line-422"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span class="hs-comment">-- Note: It is crucial to use reverse function composition here or to</span><span>
</span><span id="line-423"></span><span>        </span><span class="hs-comment">-- reverse the flags here as we want to process the flags left to right</span><span>
</span><span id="line-424"></span><span>        </span><span class="hs-comment">-- but data flow in function composition is right to left.</span><span>
</span><span id="line-425"></span><span>        </span><span id="local-6989586621679689229"><span class="annot"><span class="annottext">accum :: [Either a (c -&gt; c)] -&gt; c -&gt; c
</span><a href="#local-6989586621679689229"><span class="hs-identifier hs-var hs-var">accum</span></a></span></span><span> </span><span id="local-6989586621679689223"><span class="annot"><span class="annottext">[Either a (c -&gt; c)]
</span><a href="#local-6989586621679689223"><span class="hs-identifier hs-var">flags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((c -&gt; c) -&gt; (c -&gt; c) -&gt; c -&gt; c) -&gt; (c -&gt; c) -&gt; [c -&gt; c] -&gt; c -&gt; c
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((c -&gt; c) -&gt; (c -&gt; c) -&gt; c -&gt; c) -&gt; (c -&gt; c) -&gt; (c -&gt; c) -&gt; c -&gt; c
forall a b c. (a -&gt; b -&gt; c) -&gt; b -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#flip"><span class="hs-identifier hs-var">flip</span></a></span><span> </span><span class="annot"><span class="annottext">(c -&gt; c) -&gt; (c -&gt; c) -&gt; c -&gt; c
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">(.)</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">c -&gt; c
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">c -&gt; c
</span><a href="#local-6989586621679689219"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621679689219"><span class="annot"><span class="annottext">c -&gt; c
</span><a href="#local-6989586621679689219"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Either a (c -&gt; c)]
</span><a href="#local-6989586621679689223"><span class="hs-identifier hs-var">flags</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-426"></span><span>        </span><span id="local-6989586621679689226"><span class="annot"><span class="annottext">unrecognised :: LFlags -&gt; LFlags
</span><a href="#local-6989586621679689226"><span class="hs-identifier hs-var hs-var">unrecognised</span></a></span></span><span> </span><span id="local-6989586621679689218"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689218"><span class="hs-identifier hs-var">opts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;unrecognized &quot;</span></span><span>
</span><span id="line-427"></span><span>                              </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;'&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CommandUI flags -&gt; String
forall flags. CommandUI flags -&gt; String
</span><a href="Distribution.Simple.Command.html#commandName"><span class="hs-identifier hs-var hs-var">commandName</span></a></span><span> </span><span class="annot"><span class="annottext">CommandUI flags
</span><a href="#local-6989586621679689249"><span class="hs-identifier hs-var">command</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;'&quot;</span></span><span>
</span><span id="line-428"></span><span>                              </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; option `&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689217"><span class="hs-identifier hs-var">opt</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;'\n&quot;</span></span><span>
</span><span id="line-429"></span><span>                            </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679689217"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689217"><span class="hs-identifier hs-var">opt</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689218"><span class="hs-identifier hs-var">opts</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-430"></span><span>        </span><span class="hs-comment">-- For unrecognised global flags we put them in the position just after</span><span>
</span><span id="line-431"></span><span>        </span><span class="hs-comment">-- the command, if there is one. This gives us a chance to parse them</span><span>
</span><span id="line-432"></span><span>        </span><span class="hs-comment">-- as sub-command rather than global flags.</span><span>
</span><span id="line-433"></span><span>        </span><span id="local-6989586621679689228"><span class="annot"><span class="annottext">mix :: [a] -&gt; [a] -&gt; [a]
</span><a href="#local-6989586621679689228"><span class="hs-identifier hs-var hs-var">mix</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span id="local-6989586621679689216"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679689216"><span class="hs-identifier hs-var">ys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679689216"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-434"></span><span>        </span><span class="annot"><a href="#local-6989586621679689228"><span class="hs-identifier hs-var">mix</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679689215"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679689215"><span class="hs-identifier hs-var">x</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679689214"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679689214"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679689213"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679689213"><span class="hs-identifier hs-var">ys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679689215"><span class="hs-identifier hs-var">x</span></a></span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; [a]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679689213"><span class="hs-identifier hs-var">ys</span></a></span><span class="annot"><span class="annottext">[a] -&gt; [a] -&gt; [a]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679689214"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-435"></span><span>
</span><span id="line-436"></span><span class="hs-keyword">data</span><span> </span><span id="CommandParse"><span class="annot"><a href="Distribution.Simple.Command.html#CommandParse"><span class="hs-identifier hs-var">CommandParse</span></a></span></span><span> </span><span id="local-6989586621679689680"><span class="annot"><a href="#local-6989586621679689680"><span class="hs-identifier hs-type">flags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="CommandHelp"><span class="annot"><a href="Distribution.Simple.Command.html#CommandHelp"><span class="hs-identifier hs-var">CommandHelp</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-437"></span><span>                        </span><span class="hs-glyph">|</span><span> </span><span id="CommandList"><span class="annot"><a href="Distribution.Simple.Command.html#CommandList"><span class="hs-identifier hs-var">CommandList</span></a></span></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-438"></span><span>                        </span><span class="hs-glyph">|</span><span> </span><span id="CommandErrors"><span class="annot"><a href="Distribution.Simple.Command.html#CommandErrors"><span class="hs-identifier hs-var">CommandErrors</span></a></span></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-439"></span><span>                        </span><span class="hs-glyph">|</span><span> </span><span id="CommandReadyToGo"><span class="annot"><a href="Distribution.Simple.Command.html#CommandReadyToGo"><span class="hs-identifier hs-var">CommandReadyToGo</span></a></span></span><span> </span><span class="annot"><a href="#local-6989586621679689680"><span class="hs-identifier hs-type">flags</span></a></span><span>
</span><span id="line-440"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679689210"><span class="annot"><a href="../../base/src/GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#CommandParse"><span class="hs-identifier hs-type">CommandParse</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-441"></span><span>  </span><span id="local-6989586621679689208"><span class="annot"><span class="annottext">fmap :: forall a b. (a -&gt; b) -&gt; CommandParse a -&gt; CommandParse b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var hs-var hs-var hs-var">fmap</span></a></span></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Command.html#CommandHelp"><span class="hs-identifier hs-type">CommandHelp</span></a></span><span> </span><span id="local-6989586621679689207"><span class="annot"><span class="annottext">String -&gt; String
</span><a href="#local-6989586621679689207"><span class="hs-identifier hs-var">help</span></a></span></span><span class="hs-special">)</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; CommandParse b
forall flags. (String -&gt; String) -&gt; CommandParse flags
</span><a href="Distribution.Simple.Command.html#CommandHelp"><span class="hs-identifier hs-var">CommandHelp</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="#local-6989586621679689207"><span class="hs-identifier hs-var">help</span></a></span><span>
</span><span id="line-442"></span><span>  </span><span class="annot"><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Command.html#CommandList"><span class="hs-identifier hs-type">CommandList</span></a></span><span> </span><span id="local-6989586621679689206"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689206"><span class="hs-identifier hs-var">opts</span></a></span></span><span class="hs-special">)</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LFlags -&gt; CommandParse b
forall flags. LFlags -&gt; CommandParse flags
</span><a href="Distribution.Simple.Command.html#CommandList"><span class="hs-identifier hs-var">CommandList</span></a></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689206"><span class="hs-identifier hs-var">opts</span></a></span><span>
</span><span id="line-443"></span><span>  </span><span class="annot"><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Command.html#CommandErrors"><span class="hs-identifier hs-type">CommandErrors</span></a></span><span> </span><span id="local-6989586621679689205"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689205"><span class="hs-identifier hs-var">errs</span></a></span></span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LFlags -&gt; CommandParse b
forall flags. LFlags -&gt; CommandParse flags
</span><a href="Distribution.Simple.Command.html#CommandErrors"><span class="hs-identifier hs-var">CommandErrors</span></a></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689205"><span class="hs-identifier hs-var">errs</span></a></span><span>
</span><span id="line-444"></span><span>  </span><span class="annot"><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span id="local-6989586621679689204"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679689204"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Command.html#CommandReadyToGo"><span class="hs-identifier hs-type">CommandReadyToGo</span></a></span><span> </span><span id="local-6989586621679689203"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679689203"><span class="hs-identifier hs-var">flags</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">b -&gt; CommandParse b
forall flags. flags -&gt; CommandParse flags
</span><a href="Distribution.Simple.Command.html#CommandReadyToGo"><span class="hs-identifier hs-var">CommandReadyToGo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679689204"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679689203"><span class="hs-identifier hs-var">flags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-445"></span><span>
</span><span id="line-446"></span><span>
</span><span id="line-447"></span><span class="hs-keyword">data</span><span> </span><span id="CommandType"><span class="annot"><a href="Distribution.Simple.Command.html#CommandType"><span class="hs-identifier hs-var">CommandType</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="NormalCommand"><span class="annot"><a href="Distribution.Simple.Command.html#NormalCommand"><span class="hs-identifier hs-var">NormalCommand</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="HiddenCommand"><span class="annot"><a href="Distribution.Simple.Command.html#HiddenCommand"><span class="hs-identifier hs-var">HiddenCommand</span></a></span></span><span>
</span><span id="line-448"></span><span class="hs-keyword">data</span><span> </span><span id="Command"><span class="annot"><a href="Distribution.Simple.Command.html#Command"><span class="hs-identifier hs-var">Command</span></a></span></span><span> </span><span id="local-6989586621679689660"><span class="annot"><a href="#local-6989586621679689660"><span class="hs-identifier hs-type">action</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-449"></span><span>  </span><span id="Command"><span class="annot"><a href="Distribution.Simple.Command.html#Command"><span class="hs-identifier hs-var">Command</span></a></span></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#CommandParse"><span class="hs-identifier hs-type">CommandParse</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689660"><span class="hs-identifier hs-type">action</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#CommandType"><span class="hs-identifier hs-type">CommandType</span></a></span><span>
</span><span id="line-450"></span><span>
</span><span id="line-451"></span><span class="hs-comment">-- | Mark command as hidden. Hidden commands don't show up in the 'progname</span><span>
</span><span id="line-452"></span><span class="hs-comment">-- help' or 'progname --help' output.</span><span>
</span><span id="line-453"></span><span id="local-6989586621679689664"><span class="annot"><a href="Distribution.Simple.Command.html#hiddenCommand"><span class="hs-identifier hs-type">hiddenCommand</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#Command"><span class="hs-identifier hs-type">Command</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689664"><span class="hs-identifier hs-type">action</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#Command"><span class="hs-identifier hs-type">Command</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689664"><span class="hs-identifier hs-type">action</span></a></span></span><span>
</span><span id="line-454"></span><span id="hiddenCommand"><span class="annot"><span class="annottext">hiddenCommand :: forall action. Command action -&gt; Command action
</span><a href="Distribution.Simple.Command.html#hiddenCommand"><span class="hs-identifier hs-var hs-var">hiddenCommand</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Command.html#Command"><span class="hs-identifier hs-type">Command</span></a></span><span> </span><span id="local-6989586621679689199"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689199"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621679689198"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689198"><span class="hs-identifier hs-var">synopsys</span></a></span></span><span> </span><span id="local-6989586621679689197"><span class="annot"><span class="annottext">LFlags -&gt; CommandParse action
</span><a href="#local-6989586621679689197"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679689196"><span class="annot"><span class="annottext">CommandType
</span><a href="#local-6989586621679689196"><span class="hs-identifier hs-var">_cmdType</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-455"></span><span>  </span><span class="annot"><span class="annottext">String
-&gt; String
-&gt; (LFlags -&gt; CommandParse action)
-&gt; CommandType
-&gt; Command action
forall action.
String
-&gt; String
-&gt; (LFlags -&gt; CommandParse action)
-&gt; CommandType
-&gt; Command action
</span><a href="Distribution.Simple.Command.html#Command"><span class="hs-identifier hs-var">Command</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689199"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689198"><span class="hs-identifier hs-var">synopsys</span></a></span><span> </span><span class="annot"><span class="annottext">LFlags -&gt; CommandParse action
</span><a href="#local-6989586621679689197"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">CommandType
</span><a href="Distribution.Simple.Command.html#HiddenCommand"><span class="hs-identifier hs-var">HiddenCommand</span></a></span><span>
</span><span id="line-456"></span><span>
</span><span id="line-457"></span><span id="local-6989586621679689658"><span id="local-6989586621679689659"><span class="annot"><a href="Distribution.Simple.Command.html#commandAddAction"><span class="hs-identifier hs-type">commandAddAction</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#CommandUI"><span class="hs-identifier hs-type">CommandUI</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689659"><span class="hs-identifier hs-type">flags</span></a></span><span>
</span><span id="line-458"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689659"><span class="hs-identifier hs-type">flags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679689658"><span class="hs-identifier hs-type">action</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-459"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#Command"><span class="hs-identifier hs-type">Command</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689658"><span class="hs-identifier hs-type">action</span></a></span></span></span><span>
</span><span id="line-460"></span><span id="commandAddAction"><span class="annot"><span class="annottext">commandAddAction :: forall flags action.
CommandUI flags -&gt; (flags -&gt; LFlags -&gt; action) -&gt; Command action
</span><a href="Distribution.Simple.Command.html#commandAddAction"><span class="hs-identifier hs-var hs-var">commandAddAction</span></a></span></span><span> </span><span id="local-6989586621679689194"><span class="annot"><span class="annottext">CommandUI flags
</span><a href="#local-6989586621679689194"><span class="hs-identifier hs-var">command</span></a></span></span><span> </span><span id="local-6989586621679689193"><span class="annot"><span class="annottext">flags -&gt; LFlags -&gt; action
</span><a href="#local-6989586621679689193"><span class="hs-identifier hs-var">action</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-461"></span><span>  </span><span class="annot"><span class="annottext">String
-&gt; String
-&gt; (LFlags -&gt; CommandParse action)
-&gt; CommandType
-&gt; Command action
forall action.
String
-&gt; String
-&gt; (LFlags -&gt; CommandParse action)
-&gt; CommandType
-&gt; Command action
</span><a href="Distribution.Simple.Command.html#Command"><span class="hs-identifier hs-var">Command</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CommandUI flags -&gt; String
forall flags. CommandUI flags -&gt; String
</span><a href="Distribution.Simple.Command.html#commandName"><span class="hs-identifier hs-var hs-var">commandName</span></a></span><span> </span><span class="annot"><span class="annottext">CommandUI flags
</span><a href="#local-6989586621679689194"><span class="hs-identifier hs-var">command</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-462"></span><span>          </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CommandUI flags -&gt; String
forall flags. CommandUI flags -&gt; String
</span><a href="Distribution.Simple.Command.html#commandSynopsis"><span class="hs-identifier hs-var hs-var">commandSynopsis</span></a></span><span> </span><span class="annot"><span class="annottext">CommandUI flags
</span><a href="#local-6989586621679689194"><span class="hs-identifier hs-var">command</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-463"></span><span>          </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((flags -&gt; flags, LFlags) -&gt; action)
-&gt; CommandParse (flags -&gt; flags, LFlags) -&gt; CommandParse action
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((flags -&gt; flags) -&gt; LFlags -&gt; action)
-&gt; (flags -&gt; flags, LFlags) -&gt; action
forall a b c. (a -&gt; b -&gt; c) -&gt; (a, b) -&gt; c
</span><a href="../../base/src/Data.Tuple.html#uncurry"><span class="hs-identifier hs-var">uncurry</span></a></span><span> </span><span class="annot"><span class="annottext">(flags -&gt; flags) -&gt; LFlags -&gt; action
</span><a href="#local-6989586621679689191"><span class="hs-identifier hs-var">applyDefaultArgs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(CommandParse (flags -&gt; flags, LFlags) -&gt; CommandParse action)
-&gt; (LFlags -&gt; CommandParse (flags -&gt; flags, LFlags))
-&gt; LFlags
-&gt; CommandParse action
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">CommandUI flags
-&gt; Bool -&gt; LFlags -&gt; CommandParse (flags -&gt; flags, LFlags)
forall flags.
CommandUI flags
-&gt; Bool -&gt; LFlags -&gt; CommandParse (flags -&gt; flags, LFlags)
</span><a href="Distribution.Simple.Command.html#commandParseArgs"><span class="hs-identifier hs-var">commandParseArgs</span></a></span><span> </span><span class="annot"><span class="annottext">CommandUI flags
</span><a href="#local-6989586621679689194"><span class="hs-identifier hs-var">command</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span class="hs-special">)</span><span>
</span><span id="line-464"></span><span>          </span><span class="annot"><span class="annottext">CommandType
</span><a href="Distribution.Simple.Command.html#NormalCommand"><span class="hs-identifier hs-var">NormalCommand</span></a></span><span>
</span><span id="line-465"></span><span>
</span><span id="line-466"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679689191"><span class="annot"><span class="annottext">applyDefaultArgs :: (flags -&gt; flags) -&gt; LFlags -&gt; action
</span><a href="#local-6989586621679689191"><span class="hs-identifier hs-var hs-var">applyDefaultArgs</span></a></span></span><span> </span><span id="local-6989586621679689190"><span class="annot"><span class="annottext">flags -&gt; flags
</span><a href="#local-6989586621679689190"><span class="hs-identifier hs-var">mkflags</span></a></span></span><span> </span><span id="local-6989586621679689189"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689189"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-467"></span><span>          </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679689188"><span class="annot"><span class="annottext">flags :: flags
</span><a href="#local-6989586621679689188"><span class="hs-identifier hs-var hs-var">flags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">flags -&gt; flags
</span><a href="#local-6989586621679689190"><span class="hs-identifier hs-var">mkflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CommandUI flags -&gt; flags
forall flags. CommandUI flags -&gt; flags
</span><a href="Distribution.Simple.Command.html#commandDefaultFlags"><span class="hs-identifier hs-var hs-var">commandDefaultFlags</span></a></span><span> </span><span class="annot"><span class="annottext">CommandUI flags
</span><a href="#local-6989586621679689194"><span class="hs-identifier hs-var">command</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-468"></span><span>           </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">flags -&gt; LFlags -&gt; action
</span><a href="#local-6989586621679689193"><span class="hs-identifier hs-var">action</span></a></span><span> </span><span class="annot"><span class="annottext">flags
</span><a href="#local-6989586621679689188"><span class="hs-identifier hs-var">flags</span></a></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689189"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-469"></span><span>
</span><span id="line-470"></span><span id="local-6989586621679689651"><span id="local-6989586621679689652"><span class="annot"><a href="Distribution.Simple.Command.html#commandsRun"><span class="hs-identifier hs-type">commandsRun</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#CommandUI"><span class="hs-identifier hs-type">CommandUI</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689652"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-471"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Simple.Command.html#Command"><span class="hs-identifier hs-type">Command</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689651"><span class="hs-identifier hs-type">action</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-472"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-473"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#CommandParse"><span class="hs-identifier hs-type">CommandParse</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679689652"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#CommandParse"><span class="hs-identifier hs-type">CommandParse</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689651"><span class="hs-identifier hs-type">action</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-474"></span><span id="commandsRun"><span class="annot"><span class="annottext">commandsRun :: forall a action.
CommandUI a
-&gt; [Command action]
-&gt; LFlags
-&gt; CommandParse (a, CommandParse action)
</span><a href="Distribution.Simple.Command.html#commandsRun"><span class="hs-identifier hs-var hs-var">commandsRun</span></a></span></span><span> </span><span id="local-6989586621679689187"><span class="annot"><span class="annottext">CommandUI a
</span><a href="#local-6989586621679689187"><span class="hs-identifier hs-var">globalCommand</span></a></span></span><span> </span><span id="local-6989586621679689186"><span class="annot"><span class="annottext">[Command action]
</span><a href="#local-6989586621679689186"><span class="hs-identifier hs-var">commands</span></a></span></span><span> </span><span id="local-6989586621679689185"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689185"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-475"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">CommandUI a -&gt; Bool -&gt; LFlags -&gt; CommandParse (a -&gt; a, LFlags)
forall flags.
CommandUI flags
-&gt; Bool -&gt; LFlags -&gt; CommandParse (flags -&gt; flags, LFlags)
</span><a href="Distribution.Simple.Command.html#commandParseArgs"><span class="hs-identifier hs-var">commandParseArgs</span></a></span><span> </span><span class="annot"><span class="annottext">CommandUI a
</span><a href="#local-6989586621679689187"><span class="hs-identifier hs-var">globalCommand</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689185"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-476"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Command.html#CommandHelp"><span class="hs-identifier hs-type">CommandHelp</span></a></span><span>      </span><span id="local-6989586621679689184"><span class="annot"><span class="annottext">String -&gt; String
</span><a href="#local-6989586621679689184"><span class="hs-identifier hs-var">help</span></a></span></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; CommandParse (a, CommandParse action)
forall flags. (String -&gt; String) -&gt; CommandParse flags
</span><a href="Distribution.Simple.Command.html#CommandHelp"><span class="hs-identifier hs-var">CommandHelp</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="#local-6989586621679689184"><span class="hs-identifier hs-var">help</span></a></span><span>
</span><span id="line-477"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Command.html#CommandList"><span class="hs-identifier hs-type">CommandList</span></a></span><span>      </span><span id="local-6989586621679689183"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689183"><span class="hs-identifier hs-var">opts</span></a></span></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">LFlags -&gt; CommandParse (a, CommandParse action)
forall flags. LFlags -&gt; CommandParse flags
</span><a href="Distribution.Simple.Command.html#CommandList"><span class="hs-identifier hs-var">CommandList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689183"><span class="hs-identifier hs-var">opts</span></a></span><span> </span><span class="annot"><span class="annottext">LFlags -&gt; LFlags -&gt; LFlags
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689182"><span class="hs-identifier hs-var">commandNames</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-478"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Command.html#CommandErrors"><span class="hs-identifier hs-type">CommandErrors</span></a></span><span>    </span><span id="local-6989586621679689181"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689181"><span class="hs-identifier hs-var">errs</span></a></span></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">LFlags -&gt; CommandParse (a, CommandParse action)
forall flags. LFlags -&gt; CommandParse flags
</span><a href="Distribution.Simple.Command.html#CommandErrors"><span class="hs-identifier hs-var">CommandErrors</span></a></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689181"><span class="hs-identifier hs-var">errs</span></a></span><span>
</span><span id="line-479"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Command.html#CommandReadyToGo"><span class="hs-identifier hs-type">CommandReadyToGo</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679689180"><span class="annot"><span class="annottext">a -&gt; a
</span><a href="#local-6989586621679689180"><span class="hs-identifier hs-var">mkflags</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679689179"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689179"><span class="hs-identifier hs-var">args'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689179"><span class="hs-identifier hs-var">args'</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-480"></span><span>      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;help&quot;</span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679689178"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689178"><span class="hs-identifier hs-var">cmdArgs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">LFlags -&gt; CommandParse (a, CommandParse action)
forall flags. LFlags -&gt; CommandParse flags
</span><a href="#local-6989586621679689177"><span class="hs-identifier hs-var">handleHelpCommand</span></a></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689178"><span class="hs-identifier hs-var">cmdArgs</span></a></span><span>
</span><span id="line-481"></span><span>      </span><span class="hs-special">(</span><span id="local-6989586621679689176"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689176"><span class="hs-identifier hs-var">name</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679689175"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689175"><span class="hs-identifier hs-var">cmdArgs</span></a></span></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">String -&gt; [Command action]
</span><a href="#local-6989586621679689174"><span class="hs-identifier hs-var">lookupCommand</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689176"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-482"></span><span>        </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Simple.Command.html#Command"><span class="hs-identifier hs-type">Command</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679689173"><span class="annot"><span class="annottext">LFlags -&gt; CommandParse action
</span><a href="#local-6989586621679689173"><span class="hs-identifier hs-var">action</span></a></span></span><span> </span><span class="annot"><span class="annottext">CommandType
</span><span class="hs-identifier">_</span></span><span class="hs-special">]</span><span>
</span><span id="line-483"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(a, CommandParse action) -&gt; CommandParse (a, CommandParse action)
forall flags. flags -&gt; CommandParse flags
</span><a href="Distribution.Simple.Command.html#CommandReadyToGo"><span class="hs-identifier hs-var">CommandReadyToGo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679689172"><span class="hs-identifier hs-var">flags</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LFlags -&gt; CommandParse action
</span><a href="#local-6989586621679689173"><span class="hs-identifier hs-var">action</span></a></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689175"><span class="hs-identifier hs-var">cmdArgs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-484"></span><span>        </span><span class="annot"><span class="annottext">[Command action]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(a, CommandParse action) -&gt; CommandParse (a, CommandParse action)
forall flags. flags -&gt; CommandParse flags
</span><a href="Distribution.Simple.Command.html#CommandReadyToGo"><span class="hs-identifier hs-var">CommandReadyToGo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679689172"><span class="hs-identifier hs-var">flags</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; CommandParse action
forall {flags}. String -&gt; CommandParse flags
</span><a href="#local-6989586621679689171"><span class="hs-identifier hs-var">badCommand</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689176"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-485"></span><span>      </span><span class="hs-special">[</span><span class="hs-special">]</span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(a, CommandParse action) -&gt; CommandParse (a, CommandParse action)
forall flags. flags -&gt; CommandParse flags
</span><a href="Distribution.Simple.Command.html#CommandReadyToGo"><span class="hs-identifier hs-var">CommandReadyToGo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679689172"><span class="hs-identifier hs-var">flags</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CommandParse action
forall {flags}. CommandParse flags
</span><a href="#local-6989586621679689170"><span class="hs-identifier hs-var">noCommand</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-486"></span><span>     </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679689172"><span class="annot"><span class="annottext">flags :: a
</span><a href="#local-6989586621679689172"><span class="hs-identifier hs-var hs-var">flags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; a
</span><a href="#local-6989586621679689180"><span class="hs-identifier hs-var">mkflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CommandUI a -&gt; a
forall flags. CommandUI flags -&gt; flags
</span><a href="Distribution.Simple.Command.html#commandDefaultFlags"><span class="hs-identifier hs-var hs-var">commandDefaultFlags</span></a></span><span> </span><span class="annot"><span class="annottext">CommandUI a
</span><a href="#local-6989586621679689187"><span class="hs-identifier hs-var">globalCommand</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-487"></span><span>
</span><span id="line-488"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-489"></span><span>    </span><span id="local-6989586621679689174"><span class="annot"><span class="annottext">lookupCommand :: String -&gt; [Command action]
</span><a href="#local-6989586621679689174"><span class="hs-identifier hs-var hs-var">lookupCommand</span></a></span></span><span> </span><span id="local-6989586621679689167"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689167"><span class="hs-identifier hs-var">cname</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Command action
</span><a href="#local-6989586621679689166"><span class="hs-identifier hs-var">cmd</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679689166"><span class="annot"><span class="annottext">cmd :: Command action
</span><a href="#local-6989586621679689166"><span class="hs-identifier hs-var">cmd</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Command.html#Command"><span class="hs-identifier hs-type">Command</span></a></span><span> </span><span id="local-6989586621679689165"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689165"><span class="hs-identifier hs-var">cname'</span></a></span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">LFlags -&gt; CommandParse action
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">CommandType
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Command action]
</span><a href="#local-6989586621679689164"><span class="hs-identifier hs-var">commands'</span></a></span><span>
</span><span id="line-490"></span><span>                                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689165"><span class="hs-identifier hs-var">cname'</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689167"><span class="hs-identifier hs-var">cname</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-491"></span><span>    </span><span id="local-6989586621679689170"><span class="annot"><span class="annottext">noCommand :: CommandParse flags
</span><a href="#local-6989586621679689170"><span class="hs-identifier hs-var hs-var">noCommand</span></a></span></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LFlags -&gt; CommandParse flags
forall flags. LFlags -&gt; CommandParse flags
</span><a href="Distribution.Simple.Command.html#CommandErrors"><span class="hs-identifier hs-var">CommandErrors</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;no command given (try --help)\n&quot;</span></span><span class="hs-special">]</span><span>
</span><span id="line-492"></span><span>    </span><span id="local-6989586621679689171"><span class="annot"><span class="annottext">badCommand :: String -&gt; CommandParse flags
</span><a href="#local-6989586621679689171"><span class="hs-identifier hs-var hs-var">badCommand</span></a></span></span><span> </span><span id="local-6989586621679689163"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689163"><span class="hs-identifier hs-var">cname</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LFlags -&gt; CommandParse flags
forall flags. LFlags -&gt; CommandParse flags
</span><a href="Distribution.Simple.Command.html#CommandErrors"><span class="hs-identifier hs-var">CommandErrors</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;unrecognised command: &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689163"><span class="hs-identifier hs-var">cname</span></a></span><span>
</span><span id="line-493"></span><span>                                   </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; (try --help)\n&quot;</span></span><span class="hs-special">]</span><span>
</span><span id="line-494"></span><span>    </span><span id="local-6989586621679689164"><span class="annot"><span class="annottext">commands' :: [Command action]
</span><a href="#local-6989586621679689164"><span class="hs-identifier hs-var hs-var">commands'</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Command action]
</span><a href="#local-6989586621679689186"><span class="hs-identifier hs-var">commands</span></a></span><span> </span><span class="annot"><span class="annottext">[Command action] -&gt; [Command action] -&gt; [Command action]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CommandUI () -&gt; (() -&gt; LFlags -&gt; action) -&gt; Command action
forall flags action.
CommandUI flags -&gt; (flags -&gt; LFlags -&gt; action) -&gt; Command action
</span><a href="Distribution.Simple.Command.html#commandAddAction"><span class="hs-identifier hs-var">commandAddAction</span></a></span><span> </span><span class="annot"><span class="annottext">CommandUI ()
</span><a href="Distribution.Simple.Command.html#helpCommandUI"><span class="hs-identifier hs-var">helpCommandUI</span></a></span><span> </span><span class="annot"><span class="annottext">() -&gt; LFlags -&gt; action
forall a. HasCallStack =&gt; a
</span><a href="../../base/src/GHC.Err.html#undefined"><span class="hs-identifier hs-var">undefined</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-495"></span><span>    </span><span id="local-6989586621679689182"><span class="annot"><span class="annottext">commandNames :: LFlags
</span><a href="#local-6989586621679689182"><span class="hs-identifier hs-var hs-var">commandNames</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689160"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Command.html#Command"><span class="hs-identifier hs-type">Command</span></a></span><span> </span><span id="local-6989586621679689160"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689160"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">LFlags -&gt; CommandParse action
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">CommandType
</span><a href="Distribution.Simple.Command.html#NormalCommand"><span class="hs-identifier hs-var">NormalCommand</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Command action]
</span><a href="#local-6989586621679689164"><span class="hs-identifier hs-var">commands'</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-496"></span><span>
</span><span id="line-497"></span><span>    </span><span class="hs-comment">-- A bit of a hack: support &quot;prog help&quot; as a synonym of &quot;prog --help&quot;</span><span>
</span><span id="line-498"></span><span>    </span><span class="hs-comment">-- furthermore, support &quot;prog help command&quot; as &quot;prog command --help&quot;</span><span>
</span><span id="line-499"></span><span>    </span><span id="local-6989586621679689177"><span class="annot"><span class="annottext">handleHelpCommand :: LFlags -&gt; CommandParse flags
</span><a href="#local-6989586621679689177"><span class="hs-identifier hs-var hs-var">handleHelpCommand</span></a></span></span><span> </span><span id="local-6989586621679689159"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689159"><span class="hs-identifier hs-var">cmdArgs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-500"></span><span>      </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">CommandUI () -&gt; Bool -&gt; LFlags -&gt; CommandParse (() -&gt; (), LFlags)
forall flags.
CommandUI flags
-&gt; Bool -&gt; LFlags -&gt; CommandParse (flags -&gt; flags, LFlags)
</span><a href="Distribution.Simple.Command.html#commandParseArgs"><span class="hs-identifier hs-var">commandParseArgs</span></a></span><span> </span><span class="annot"><span class="annottext">CommandUI ()
</span><a href="Distribution.Simple.Command.html#helpCommandUI"><span class="hs-identifier hs-var">helpCommandUI</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689159"><span class="hs-identifier hs-var">cmdArgs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-501"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Command.html#CommandHelp"><span class="hs-identifier hs-type">CommandHelp</span></a></span><span>      </span><span id="local-6989586621679689158"><span class="annot"><span class="annottext">String -&gt; String
</span><a href="#local-6989586621679689158"><span class="hs-identifier hs-var">help</span></a></span></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; CommandParse flags
forall flags. (String -&gt; String) -&gt; CommandParse flags
</span><a href="Distribution.Simple.Command.html#CommandHelp"><span class="hs-identifier hs-var">CommandHelp</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="#local-6989586621679689158"><span class="hs-identifier hs-var">help</span></a></span><span>
</span><span id="line-502"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Command.html#CommandList"><span class="hs-identifier hs-type">CommandList</span></a></span><span>      </span><span id="local-6989586621679689157"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689157"><span class="hs-identifier hs-var">list</span></a></span></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">LFlags -&gt; CommandParse flags
forall flags. LFlags -&gt; CommandParse flags
</span><a href="Distribution.Simple.Command.html#CommandList"><span class="hs-identifier hs-var">CommandList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689157"><span class="hs-identifier hs-var">list</span></a></span><span> </span><span class="annot"><span class="annottext">LFlags -&gt; LFlags -&gt; LFlags
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689182"><span class="hs-identifier hs-var">commandNames</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-503"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Command.html#CommandErrors"><span class="hs-identifier hs-type">CommandErrors</span></a></span><span>    </span><span class="annot"><span class="annottext">LFlags
</span><span class="hs-identifier">_</span></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; CommandParse flags
forall flags. (String -&gt; String) -&gt; CommandParse flags
</span><a href="Distribution.Simple.Command.html#CommandHelp"><span class="hs-identifier hs-var">CommandHelp</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="#local-6989586621679689156"><span class="hs-identifier hs-var">globalHelp</span></a></span><span>
</span><span id="line-504"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Command.html#CommandReadyToGo"><span class="hs-identifier hs-type">CommandReadyToGo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">() -&gt; ()
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; CommandParse flags
forall flags. (String -&gt; String) -&gt; CommandParse flags
</span><a href="Distribution.Simple.Command.html#CommandHelp"><span class="hs-identifier hs-var">CommandHelp</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="#local-6989586621679689156"><span class="hs-identifier hs-var">globalHelp</span></a></span><span>
</span><span id="line-505"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Command.html#CommandReadyToGo"><span class="hs-identifier hs-type">CommandReadyToGo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">() -&gt; ()
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span class="hs-special">(</span><span id="local-6989586621679689155"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689155"><span class="hs-identifier hs-var">name</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679689154"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689154"><span class="hs-identifier hs-var">cmdArgs'</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-506"></span><span>          </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">String -&gt; [Command action]
</span><a href="#local-6989586621679689174"><span class="hs-identifier hs-var">lookupCommand</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689155"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-507"></span><span>            </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Simple.Command.html#Command"><span class="hs-identifier hs-type">Command</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679689153"><span class="annot"><span class="annottext">LFlags -&gt; CommandParse action
</span><a href="#local-6989586621679689153"><span class="hs-identifier hs-var">action</span></a></span></span><span> </span><span class="annot"><span class="annottext">CommandType
</span><span class="hs-identifier">_</span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-508"></span><span>              </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">LFlags -&gt; CommandParse action
</span><a href="#local-6989586621679689153"><span class="hs-identifier hs-var">action</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;--help&quot;</span></span><span class="annot"><span class="annottext">String -&gt; LFlags -&gt; LFlags
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689154"><span class="hs-identifier hs-var">cmdArgs'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-509"></span><span>                </span><span class="annot"><a href="Distribution.Simple.Command.html#CommandHelp"><span class="hs-identifier hs-type">CommandHelp</span></a></span><span> </span><span id="local-6989586621679689152"><span class="annot"><span class="annottext">String -&gt; String
</span><a href="#local-6989586621679689152"><span class="hs-identifier hs-var">help</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; CommandParse flags
forall flags. (String -&gt; String) -&gt; CommandParse flags
</span><a href="Distribution.Simple.Command.html#CommandHelp"><span class="hs-identifier hs-var">CommandHelp</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="#local-6989586621679689152"><span class="hs-identifier hs-var">help</span></a></span><span>
</span><span id="line-510"></span><span>                </span><span class="annot"><a href="Distribution.Simple.Command.html#CommandList"><span class="hs-identifier hs-type">CommandList</span></a></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><span class="hs-identifier">_</span></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">LFlags -&gt; CommandParse flags
forall flags. LFlags -&gt; CommandParse flags
</span><a href="Distribution.Simple.Command.html#CommandList"><span class="hs-identifier hs-var">CommandList</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-511"></span><span>                </span><span class="annot"><span class="annottext">CommandParse action
</span><span class="hs-identifier">_</span></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; CommandParse flags
forall flags. (String -&gt; String) -&gt; CommandParse flags
</span><a href="Distribution.Simple.Command.html#CommandHelp"><span class="hs-identifier hs-var">CommandHelp</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="#local-6989586621679689156"><span class="hs-identifier hs-var">globalHelp</span></a></span><span>
</span><span id="line-512"></span><span>            </span><span class="annot"><span class="annottext">[Command action]
</span><span class="hs-identifier">_</span></span><span>                    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; CommandParse flags
forall {flags}. String -&gt; CommandParse flags
</span><a href="#local-6989586621679689171"><span class="hs-identifier hs-var">badCommand</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689155"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-513"></span><span>
</span><span id="line-514"></span><span>     </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679689156"><span class="annot"><span class="annottext">globalHelp :: String -&gt; String
</span><a href="#local-6989586621679689156"><span class="hs-identifier hs-var hs-var">globalHelp</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CommandUI a -&gt; String -&gt; String
forall flags. CommandUI flags -&gt; String -&gt; String
</span><a href="Distribution.Simple.Command.html#commandHelp"><span class="hs-identifier hs-var">commandHelp</span></a></span><span> </span><span class="annot"><span class="annottext">CommandUI a
</span><a href="#local-6989586621679689187"><span class="hs-identifier hs-var">globalCommand</span></a></span><span>
</span><span id="line-515"></span><span>
</span><span id="line-516"></span><span class="hs-comment">-- | Utility function, many commands do not accept additional flags. This</span><span>
</span><span id="line-517"></span><span class="hs-comment">-- action fails with a helpful error message if the user supplies any extra.</span><span>
</span><span id="line-518"></span><span class="hs-comment">--</span><span>
</span><span id="line-519"></span><span class="annot"><a href="Distribution.Simple.Command.html#noExtraFlags"><span class="hs-identifier hs-type">noExtraFlags</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-520"></span><span id="noExtraFlags"><span class="annot"><span class="annottext">noExtraFlags :: LFlags -&gt; IO ()
</span><a href="Distribution.Simple.Command.html#noExtraFlags"><span class="hs-identifier hs-var hs-var">noExtraFlags</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-521"></span><span class="annot"><a href="Distribution.Simple.Command.html#noExtraFlags"><span class="hs-identifier hs-var">noExtraFlags</span></a></span><span> </span><span id="local-6989586621679689151"><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689151"><span class="hs-identifier hs-var">extraFlags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-522"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; IO ()
forall a. String -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#dieNoVerbosity"><span class="hs-identifier hs-var">dieNoVerbosity</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO ()) -&gt; String -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Unrecognised flags: &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; LFlags -&gt; String
forall a. [a] -&gt; [[a]] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#intercalate"><span class="hs-identifier hs-var">intercalate</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;, &quot;</span></span><span> </span><span class="annot"><span class="annottext">LFlags
</span><a href="#local-6989586621679689151"><span class="hs-identifier hs-var">extraFlags</span></a></span><span>
</span><span id="line-523"></span><span class="hs-comment">--TODO: eliminate this function and turn it into a variant on commandAddAction</span><span>
</span><span id="line-524"></span><span class="hs-comment">--      instead like commandAddActionNoArgs that doesn't supply the [String]</span><span>
</span><span id="line-525"></span><span>
</span><span id="line-526"></span><span class="hs-comment">-- | Helper function for creating globalCommand description</span><span>
</span><span id="line-527"></span><span id="local-6989586621679689641"><span class="annot"><a href="Distribution.Simple.Command.html#getNormalCommandDescriptions"><span class="hs-identifier hs-type">getNormalCommandDescriptions</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Simple.Command.html#Command"><span class="hs-identifier hs-type">Command</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689641"><span class="hs-identifier hs-type">action</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span></span><span>
</span><span id="line-528"></span><span id="getNormalCommandDescriptions"><span class="annot"><span class="annottext">getNormalCommandDescriptions :: forall action. [Command action] -&gt; [(String, String)]
</span><a href="Distribution.Simple.Command.html#getNormalCommandDescriptions"><span class="hs-identifier hs-var hs-var">getNormalCommandDescriptions</span></a></span></span><span> </span><span id="local-6989586621679689148"><span class="annot"><span class="annottext">[Command action]
</span><a href="#local-6989586621679689148"><span class="hs-identifier hs-var">cmds</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-529"></span><span>  </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689147"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689146"><span class="hs-identifier hs-var">description</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-530"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#Command"><span class="hs-identifier hs-type">Command</span></a></span><span> </span><span id="local-6989586621679689147"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689147"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621679689146"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689146"><span class="hs-identifier hs-var">description</span></a></span></span><span> </span><span class="annot"><span class="annottext">LFlags -&gt; CommandParse action
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">CommandType
</span><a href="Distribution.Simple.Command.html#NormalCommand"><span class="hs-identifier hs-var">NormalCommand</span></a></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Command action]
</span><a href="#local-6989586621679689148"><span class="hs-identifier hs-var">cmds</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-531"></span><span>
</span><span id="line-532"></span><span class="annot"><a href="Distribution.Simple.Command.html#helpCommandUI"><span class="hs-identifier hs-type">helpCommandUI</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#CommandUI"><span class="hs-identifier hs-type">CommandUI</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-533"></span><span id="helpCommandUI"><span class="annot"><span class="annottext">helpCommandUI :: CommandUI ()
</span><a href="Distribution.Simple.Command.html#helpCommandUI"><span class="hs-identifier hs-var hs-var">helpCommandUI</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-534"></span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
-&gt; String
-&gt; LFlags
-&gt; ()
-&gt; (ShowOrParseArgs -&gt; [OptionField ()])
-&gt; CommandUI ()
forall flags.
String
-&gt; String
-&gt; LFlags
-&gt; flags
-&gt; (ShowOrParseArgs -&gt; [OptionField flags])
-&gt; CommandUI flags
</span><a href="Distribution.Simple.Command.html#mkCommandUI"><span class="hs-identifier hs-var">mkCommandUI</span></a></span><span>
</span><span id="line-535"></span><span>    </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;help&quot;</span></span><span>
</span><span id="line-536"></span><span>    </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Help about commands.&quot;</span></span><span>
</span><span id="line-537"></span><span>    </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;[FLAGS]&quot;</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;COMMAND [FLAGS]&quot;</span></span><span class="hs-special">]</span><span>
</span><span id="line-538"></span><span>    </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-539"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[OptionField ()] -&gt; ShowOrParseArgs -&gt; [OptionField ()]
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-540"></span><span>  </span><span class="hs-special">{</span><span>
</span><span id="line-541"></span><span>    </span><span class="annot"><span class="annottext">commandNotes :: Maybe (String -&gt; String)
</span><a href="Distribution.Simple.Command.html#commandNotes"><span class="hs-identifier hs-var">commandNotes</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; Maybe (String -&gt; String)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">((String -&gt; String) -&gt; Maybe (String -&gt; String))
-&gt; (String -&gt; String) -&gt; Maybe (String -&gt; String)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679689144"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689144"><span class="hs-identifier hs-var">pname</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-542"></span><span>       </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Examples:\n&quot;</span></span><span>
</span><span id="line-543"></span><span>    </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;  &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679689144"><span class="hs-identifier hs-var">pname</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; help help\n&quot;</span></span><span>
</span><span id="line-544"></span><span>    </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;    Oh, appararently you already know this.\n&quot;</span></span><span>
</span><span id="line-545"></span><span>  </span><span class="hs-special">}</span><span>
</span><span id="line-546"></span><span>
</span><span id="line-547"></span><span class="hs-comment">-- | wraps a @CommandUI@ together with a function that turns it into a @Command@.</span><span>
</span><span id="line-548"></span><span class="hs-comment">-- By hiding the type of flags for the UI allows construction of a list of all UIs at the</span><span>
</span><span id="line-549"></span><span class="hs-comment">-- top level of the program. That list can then be used for generation of manual page</span><span>
</span><span id="line-550"></span><span class="hs-comment">-- as well as for executing the selected command.</span><span>
</span><span id="line-551"></span><span class="hs-keyword">data</span><span> </span><span id="CommandSpec"><span class="annot"><a href="Distribution.Simple.Command.html#CommandSpec"><span class="hs-identifier hs-var">CommandSpec</span></a></span></span><span> </span><span id="local-6989586621679689143"><span class="annot"><a href="#local-6989586621679689143"><span class="hs-identifier hs-type">action</span></a></span></span><span>
</span><span id="line-552"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679689142"><span class="annot"><a href="#local-6989586621679689142"><span class="hs-identifier hs-type">flags</span></a></span></span><span class="hs-operator">.</span><span> </span><span id="CommandSpec"><span class="annot"><a href="Distribution.Simple.Command.html#CommandSpec"><span class="hs-identifier hs-var">CommandSpec</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Command.html#CommandUI"><span class="hs-identifier hs-type">CommandUI</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689142"><span class="hs-identifier hs-type">flags</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Command.html#CommandUI"><span class="hs-identifier hs-type">CommandUI</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689142"><span class="hs-identifier hs-type">flags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#Command"><span class="hs-identifier hs-type">Command</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689143"><span class="hs-identifier hs-type">action</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#CommandType"><span class="hs-identifier hs-type">CommandType</span></a></span><span>
</span><span id="line-553"></span><span>
</span><span id="line-554"></span><span id="local-6989586621679689637"><span class="annot"><a href="Distribution.Simple.Command.html#commandFromSpec"><span class="hs-identifier hs-type">commandFromSpec</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#CommandSpec"><span class="hs-identifier hs-type">CommandSpec</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689637"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Command.html#Command"><span class="hs-identifier hs-type">Command</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679689637"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-555"></span><span id="commandFromSpec"><span class="annot"><span class="annottext">commandFromSpec :: forall a. CommandSpec a -&gt; Command a
</span><a href="Distribution.Simple.Command.html#commandFromSpec"><span class="hs-identifier hs-var hs-var">commandFromSpec</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Command.html#CommandSpec"><span class="hs-identifier hs-type">CommandSpec</span></a></span><span> </span><span id="local-6989586621679689140"><span class="annot"><span class="annottext">CommandUI flags
</span><a href="#local-6989586621679689140"><span class="hs-identifier hs-var">ui</span></a></span></span><span> </span><span id="local-6989586621679689139"><span class="annot"><span class="annottext">CommandUI flags -&gt; Command a
</span><a href="#local-6989586621679689139"><span class="hs-identifier hs-var">action</span></a></span></span><span> </span><span class="annot"><span class="annottext">CommandType
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CommandUI flags -&gt; Command a
</span><a href="#local-6989586621679689139"><span class="hs-identifier hs-var">action</span></a></span><span> </span><span class="annot"><span class="annottext">CommandUI flags
</span><a href="#local-6989586621679689140"><span class="hs-identifier hs-var">ui</span></a></span><span>
</span><span id="line-556"></span></pre></body></html>